<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="common/css/sf.css" rel="stylesheet" type="text/css" />
<title>MoreStlc: More on the Simply Typed Lambda-Calculus</title>
<link href="common/jquery-ui/jquery-ui.css" rel="stylesheet">
<script src="common/jquery-ui/external/jquery/jquery.js"></script>
<script src="common/jquery-ui/jquery-ui.js"></script>
<script src="common/toggleproofs.js"></script>
<link href="common/css/plf.css" rel="stylesheet" type="text/css"/>
</head>

<body>

<div id="page">

<div id="header">
<div id='logoinheader'><a href='https://softwarefoundations.cis.upenn.edu'>
<img src='common/media/image/sf_logo_sm.png' alt='Software Foundations Logo'></a></div>
<div class='booktitleinheader'><a href='index.html'>Volume 2: Programming Language Foundations</a></div>
<ul id='menu'>
   <li class='section_name'><a href='toc.html'>Table of Contents</a></li>
   <li class='section_name'><a href='coqindex.html'>Index</a></li>
   <li class='section_name'><a href='deps.html'>Roadmap</a></li>
</ul>
</div>

<div id="main">

<h1 class="libtitle">MoreStlc<span class="subtitle">More on the Simply Typed Lambda-Calculus</span></h1>

<div class="code">
</div>

<div class="code">

<br/>
<span class="id" title="keyword">Set</span> <span class="id" title="var">Warnings</span> "-notation-overridden,-parsing".<br/>
<span class="id" title="keyword">From</span> <span class="id" title="var">PLF</span> <span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <span class="id" title="library">Maps</span>.<br/>
<span class="id" title="keyword">From</span> <span class="id" title="var">PLF</span> <span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="Types.html#"><span class="id" title="library">Types</span></a>.<br/>
<span class="id" title="keyword">From</span> <span class="id" title="var">PLF</span> <span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="Smallstep.html#"><span class="id" title="library">Smallstep</span></a>.<br/>
<span class="id" title="keyword">From</span> <span class="id" title="var">PLF</span> <span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="Stlc.html#"><span class="id" title="library">Stlc</span></a>.<br/>
</div>

<div class="doc">
<a id="lab263"></a><h1 class="section">Simple Extensions to STLC</h1>

<div class="paragraph"> </div>

 The simply typed lambda-calculus has enough structure to make its
    theoretical properties interesting, but it is not much of a
    programming language!

<div class="paragraph"> </div>

    In this chapter, we begin to close the gap with real-world
    languages by introducing a number of familiar features that have
    straightforward treatments at the level of typing. 
<div class="paragraph"> </div>

<a id="lab264"></a><h2 class="section">Numbers</h2>

<div class="paragraph"> </div>

 As we saw in exercise <span class="inlinecode"><span class="id" title="var">stlc_arith</span></span> at the end of the <span class="inlinecode"><span class="id" title="var">StlcProp</span></span>
    chapter, adding types, constants, and primitive operations for
    natural numbers is easy -- basically just a matter of combining
    the <a href="Types.html"><span class="inlineref">Types</span></a> and <a href="Stlc.html"><span class="inlineref">Stlc</span></a> chapters.  Adding more realistic
    numeric types like machine integers and floats is also
    straightforward, though of course the specifications of the
    numeric primitives become more fiddly. 
<div class="paragraph"> </div>

<a id="lab265"></a><h2 class="section">Let Bindings</h2>

<div class="paragraph"> </div>

 When writing a complex expression, it is useful to be able
    to give names to some of its subexpressions to avoid repetition
    and increase readability.  Most languages provide one or more ways
    of doing this.  In OCaml (and Coq), for example, we can write <span class="inlinecode"><span class="id" title="keyword">let</span></span>
    <span class="inlinecode"><span class="id" title="var">x</span>=<span class="id" title="var">t<sub>1</sub></span></span> <span class="inlinecode"><span class="id" title="tactic">in</span></span> <span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span> to mean "reduce the expression <span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span> to a value and
    bind the name <span class="inlinecode"><span class="id" title="var">x</span></span> to this value while reducing <span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span>."

<div class="paragraph"> </div>

    Our <span class="inlinecode"><span class="id" title="keyword">let</span></span>-binder follows OCaml in choosing a standard
    <i>call-by-value</i> evaluation order, where the <span class="inlinecode"><span class="id" title="keyword">let</span></span>-bound term must
    be fully reduced before reduction of the <span class="inlinecode"><span class="id" title="keyword">let</span></span>-body can begin.
    The typing rule <span class="inlinecode"><span class="id" title="var">T_Let</span></span> tells us that the type of a <span class="inlinecode"><span class="id" title="keyword">let</span></span> can be
    calculated by calculating the type of the <span class="inlinecode"><span class="id" title="keyword">let</span></span>-bound term,
    extending the context with a binding with this type, and in this
    enriched context calculating the type of the body (which is then
    the type of the whole <span class="inlinecode"><span class="id" title="keyword">let</span></span> expression).

<div class="paragraph"> </div>

    At this point in the book, it's probably easier simply to look at
    the rules defining this new feature than to wade through a lot of
    English text conveying the same information.  Here they are: 
<div class="paragraph"> </div>

 Syntax:
<pre>
       t <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                Terms
           | ...               (other terms same as before)
           | let x=t in t      let-binding
</pre>

<div class="paragraph"> </div>


<div class="paragraph"> </div>

    Reduction:
<center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">t<sub>1</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>1</sub>'</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_Let1) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">let x=t<sub>1</sub> in t<sub>2</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> let x=t<sub>1</sub>' in t<sub>2</sub></td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">&nbsp;&nbsp;</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_LetValue) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">let x=v<sub>1</sub> in t<sub>2</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> [x:=v<sub>1</sub>]t<sub>2</sub></td>
  <td></td>
</td>
</table></center>    Typing:
<center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>1</sub> &#x2208; T<sub>1</sub>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x<span class="nowrap"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>&#x22A2;</span><span style='font-size:90%;'>&gt;</span></span></span></span></span>T<sub>1</sub>; Gamma &#x22A2; t<sub>2</sub> &#x2208; T<sub>2</sub></td>
  <td class="infrulenamecol" rowspan="3">
    (T_Let) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; let x=t<sub>1</sub> in t<sub>2</sub> &#x2208; T<sub>2</sub></td>
  <td></td>
</td>
</table></center>
<div class="paragraph"> </div>

<a id="lab266"></a><h2 class="section">Pairs</h2>

<div class="paragraph"> </div>

 Our functional programming examples in Coq have made
    frequent use of <i>pairs</i> of values.  The type of such a pair is
    called a <i>product type</i>.

<div class="paragraph"> </div>

    The formalization of pairs is almost too simple to be worth
    discussing.  However, let's look briefly at the various parts of
    the definition to emphasize the common pattern. 
<div class="paragraph"> </div>

 In Coq, the primitive way of extracting the components of a pair
    is <i>pattern matching</i>.  An alternative is to take <span class="inlinecode"><span class="id" title="var">fst</span></span> and
    <span class="inlinecode"><span class="id" title="var">snd</span></span> -- the first- and second-projection operators -- as
    primitives.  Just for fun, let's do our pairs this way.  For
    example, here's how we'd write a function that takes a pair of
    numbers and returns the pair of their sum and difference:
<pre>
       \x : Nat*Nat,
          let sum = x.fst + x.snd in
          let diff = x.fst - x.snd in
          (sum,diff)
</pre>

<div class="paragraph"> </div>

 Adding pairs to the simply typed lambda-calculus, then, involves
    adding two new forms of term -- pairing, written <span class="inlinecode">(<span class="id" title="var">t<sub>1</sub></span>,<span class="id" title="var">t<sub>2</sub></span>)</span>, and
    projection, written <span class="inlinecode"><span class="id" title="var">t.fst</span></span> for the first projection from <span class="inlinecode"><span class="id" title="var">t</span></span> and
    <span class="inlinecode"><span class="id" title="var">t.snd</span></span> for the second projection -- plus one new type constructor,
    <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span>×<span class="id" title="var">T<sub>2</sub></span></span>, called the <i>product</i> of <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span> and <span class="inlinecode"><span class="id" title="var">T<sub>2</sub></span></span>.  
<div class="paragraph"> </div>

 Syntax:
<pre>
       t <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                Terms
           | ...
           | (t,t)             pair
           | t.fst             first projection
           | t.snd             second projection

       v <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                Values
           | ...
           | (v,v)             pair value

       T <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                Types
           | ...
           | T * T             product type
</pre>

<div class="paragraph"> </div>

 For reduction, we need several new rules specifying how pairs and
    projection behave. 
<div class="paragraph"> </div>

<center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">t<sub>1</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>1</sub>'</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_Pair1) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">(t<sub>1</sub>,t<sub>2</sub>) <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> (t<sub>1</sub>',t<sub>2</sub>)</td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">t<sub>2</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>2</sub>'</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_Pair2) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">(v<sub>1</sub>,t<sub>2</sub>) <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> (v<sub>1</sub>,t<sub>2</sub>')</td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">t<sub>1</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>1</sub>'</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_Fst1) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">t<sub>1</sub>.fst <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>1</sub>'.fst</td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">&nbsp;&nbsp;</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_FstPair) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">(v<sub>1</sub>,v<sub>2</sub>).fst <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> v<sub>1</sub></td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">t<sub>1</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>1</sub>'</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_Snd1) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">t<sub>1</sub>.snd <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>1</sub>'.snd</td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">&nbsp;&nbsp;</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_SndPair) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">(v<sub>1</sub>,v<sub>2</sub>).snd <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> v<sub>2</sub></td>
  <td></td>
</td>
</table></center>
<div class="paragraph"> </div>

 Rules <span class="inlinecode"><span class="id" title="var">ST_FstPair</span></span> and <span class="inlinecode"><span class="id" title="var">ST_SndPair</span></span> say that, when a fully
    reduced pair meets a first or second projection, the result is
    the appropriate component.  The congruence rules <span class="inlinecode"><span class="id" title="var">ST_Fst1</span></span> and
    <span class="inlinecode"><span class="id" title="var">ST_Snd1</span></span> allow reduction to proceed under projections, when the
    term being projected from has not yet been fully reduced.
    <span class="inlinecode"><span class="id" title="var">ST_Pair1</span></span> and <span class="inlinecode"><span class="id" title="var">ST_Pair2</span></span> reduce the parts of pairs: first the
    left part, and then -- when a value appears on the left -- the right
    part.  The ordering arising from the use of the metavariables <span class="inlinecode"><span class="id" title="var">v</span></span>
    and <span class="inlinecode"><span class="id" title="var">t</span></span> in these rules enforces a left-to-right evaluation
    strategy for pairs.  (Note the implicit convention that
    metavariables like <span class="inlinecode"><span class="id" title="var">v</span></span> and <span class="inlinecode"><span class="id" title="var">v<sub>1</sub></span></span> can only denote values.)  We've
    also added a clause to the definition of values, above, specifying
    that <span class="inlinecode">(<span class="id" title="var">v<sub>1</sub></span>,<span class="id" title="var">v<sub>2</sub></span>)</span> is a value.  The fact that the components of a pair
    value must themselves be values ensures that a pair passed as an
    argument to a function will be fully reduced before the function
    body starts executing. 
<div class="paragraph"> </div>

 The typing rules for pairs and projections are straightforward. 
<div class="paragraph"> </div>

<center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>1</sub> &#x2208; T<sub>1</sub>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gamma &#x22A2; t<sub>2</sub> &#x2208; T<sub>2</sub></td>
  <td class="infrulenamecol" rowspan="3">
    (T_Pair) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; (t<sub>1</sub>,t<sub>2</sub>) &#x2208; T<sub>1</sub>*T<sub>2</sub></td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>0</sub> &#x2208; T<sub>1</sub>*T<sub>2</sub></td>
  <td class="infrulenamecol" rowspan="3">
    (T_Fst) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>0</sub>.fst &#x2208; T<sub>1</sub></td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>0</sub> &#x2208; T<sub>1</sub>*T<sub>2</sub></td>
  <td class="infrulenamecol" rowspan="3">
    (T_Snd) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>0</sub>.snd &#x2208; T<sub>2</sub></td>
  <td></td>
</td>
</table></center>
<div class="paragraph"> </div>

 <span class="inlinecode"><span class="id" title="var">T_Pair</span></span> says that <span class="inlinecode">(<span class="id" title="var">t<sub>1</sub></span>,<span class="id" title="var">t<sub>2</sub></span>)</span> has type <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span>×<span class="id" title="var">T<sub>2</sub></span></span> if <span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span> has
    type <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span> and <span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span> has type <span class="inlinecode"><span class="id" title="var">T<sub>2</sub></span></span>.  Conversely, <span class="inlinecode"><span class="id" title="var">T_Fst</span></span> and <span class="inlinecode"><span class="id" title="var">T_Snd</span></span>
    tell us that, if <span class="inlinecode"><span class="id" title="var">t<sub>0</sub></span></span> has a product type <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span>×<span class="id" title="var">T<sub>2</sub></span></span> (i.e., if it
    will reduce to a pair), then the types of the projections from
    this pair are <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span> and <span class="inlinecode"><span class="id" title="var">T<sub>2</sub></span></span>. 
<div class="paragraph"> </div>

<a id="lab267"></a><h2 class="section">Unit</h2>

<div class="paragraph"> </div>

 Another handy base type, found especially in functional languages,
    is the singleton type <span class="inlinecode"><span class="id" title="var">Unit</span></span>.  It has a single element -- the term constant <span class="inlinecode"><span class="id" title="var">unit</span></span> (with a small
    <span class="inlinecode"><span class="id" title="var">u</span></span>) -- and a typing rule making <span class="inlinecode"><span class="id" title="var">unit</span></span> an element of <span class="inlinecode"><span class="id" title="var">Unit</span></span>.  We
    also add <span class="inlinecode"><span class="id" title="var">unit</span></span> to the set of possible values -- indeed, <span class="inlinecode"><span class="id" title="var">unit</span></span> is
    the <i>only</i> possible result of reducing an expression of type
    <span class="inlinecode"><span class="id" title="var">Unit</span></span>. 
<div class="paragraph"> </div>

 Syntax:
<pre>
       t <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                Terms
           | ...               (other terms same as before)
           | unit              unit

       v <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                Values
           | ...
           | unit              unit value

       T <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                Types
           | ...
           | Unit              unit type
</pre>
    Typing:
<center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">&nbsp;&nbsp;</td>
  <td class="infrulenamecol" rowspan="3">
    (T_Unit) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; unit &#x2208; Unit</td>
  <td></td>
</td>
</table></center>
<div class="paragraph"> </div>

 It may seem a little strange to bother defining a type that
    has just one element -- after all, wouldn't every computation
    living in such a type be trivial?

<div class="paragraph"> </div>

    This is a fair question, and indeed in the STLC the <span class="inlinecode"><span class="id" title="var">Unit</span></span> type is
    not especially critical (though we'll see two uses for it below).
    Where <span class="inlinecode"><span class="id" title="var">Unit</span></span> really comes in handy is in richer languages with
    <i>side effects</i> -- e.g., assignment statements that mutate
    variables or pointers, exceptions and other sorts of nonlocal
    control structures, etc.  In such languages, it is convenient to
    have a type for the (trivial) result of an expression that is
    evaluated only for its effect. 
<div class="paragraph"> </div>

<a id="lab268"></a><h2 class="section">Sums</h2>

<div class="paragraph"> </div>

 Many programs need to deal with values that can take two distinct
   forms.  For example, we might identify students in a university
   database using <i>either</i> their name <i>or</i> their id number. A search
   function might return <i>either</i> a matching value <i>or</i> an error code.

<div class="paragraph"> </div>

   These are specific examples of a binary <i>sum type</i> (sometimes called
   a <i>disjoint union</i>), which describes a set of values drawn from
   one of two given types, e.g.:
<pre>
       Nat + Bool
</pre>
 We create elements of these types by <i>tagging</i> elements of
    the component types.  For example, if <span class="inlinecode"><span class="id" title="var">n</span></span> is a <span class="inlinecode"><span class="id" title="var">Nat</span></span> then <span class="inlinecode"><span class="id" title="var">inl</span></span> <span class="inlinecode"><span class="id" title="var">n</span></span>
    is an element of <span class="inlinecode"><span class="id" title="var">Nat</span>+<span class="id" title="var">Bool</span></span>; similarly, if <span class="inlinecode"><span class="id" title="var">b</span></span> is a <span class="inlinecode"><span class="id" title="var">Bool</span></span> then
    <span class="inlinecode"><span class="id" title="var">inr</span></span> <span class="inlinecode"><span class="id" title="var">b</span></span> is a <span class="inlinecode"><span class="id" title="var">Nat</span>+<span class="id" title="var">Bool</span></span>.  The names of the tags <span class="inlinecode"><span class="id" title="var">inl</span></span> and <span class="inlinecode"><span class="id" title="var">inr</span></span>
    arise from thinking of them as functions
<pre>
       inl &#x2208; Nat  <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> Nat + Bool
       inr &#x2208; Bool <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> Nat + Bool
</pre>
    that "inject" elements of <span class="inlinecode"><span class="id" title="var">Nat</span></span> or <span class="inlinecode"><span class="id" title="var">Bool</span></span> into the left and right
    components of the sum type <span class="inlinecode"><span class="id" title="var">Nat</span>+<span class="id" title="var">Bool</span></span>.  (But note that we don't
    actually treat them as functions in the way we formalize them:
    <span class="inlinecode"><span class="id" title="var">inl</span></span> and <span class="inlinecode"><span class="id" title="var">inr</span></span> are keywords, and <span class="inlinecode"><span class="id" title="var">inl</span></span> <span class="inlinecode"><span class="id" title="var">t</span></span> and <span class="inlinecode"><span class="id" title="var">inr</span></span> <span class="inlinecode"><span class="id" title="var">t</span></span> are primitive
    syntactic forms, not function applications.) 
<div class="paragraph"> </div>

 In general, the elements of a type <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span> <span class="inlinecode">+</span> <span class="inlinecode"><span class="id" title="var">T<sub>2</sub></span></span> consist of the
    elements of <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span> tagged with the token <span class="inlinecode"><span class="id" title="var">inl</span></span>, plus the elements of
    <span class="inlinecode"><span class="id" title="var">T<sub>2</sub></span></span> tagged with <span class="inlinecode"><span class="id" title="var">inr</span></span>. 
<div class="paragraph"> </div>

 As we've seen in Coq programming, one important use of sums is
    signaling errors:
<pre>
      div &#x2208; Nat <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> Nat <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> (Nat + Unit)
      div =
        \x:Nat, \y:Nat,
          test iszero y then
            inr unit
          else
            inl ...
</pre>
 The type <span class="inlinecode"><span class="id" title="var">Nat</span></span> <span class="inlinecode">+</span> <span class="inlinecode"><span class="id" title="var">Unit</span></span> above is in fact isomorphic to <span class="inlinecode"><span class="id" title="var">option</span></span>
    <span class="inlinecode"><span class="id" title="var">nat</span></span> in Coq -- i.e., it's easy to write functions that translate
    back and forth. 
<div class="paragraph"> </div>

 To <i>use</i> elements of sum types, we introduce a <span class="inlinecode"><span class="id" title="tactic">case</span></span>
    construct (a very simplified form of Coq's <span class="inlinecode"><span class="id" title="keyword">match</span></span>) to destruct
    them. For example, the following procedure converts a <span class="inlinecode"><span class="id" title="var">Nat</span>+<span class="id" title="var">Bool</span></span>
    into a <span class="inlinecode"><span class="id" title="var">Nat</span></span>: 
<div class="paragraph"> </div>

<pre>
    getNat &#x2208; Nat+Bool <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> Nat
    getNat =
      \x:Nat+Bool,
        case x of
          inl n =&gt; n
        | inr b =&gt; test b then 1 else 0
</pre>
 More formally... 
<div class="paragraph"> </div>

 Syntax:
<pre>
       t <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                Terms
           | ...               (other terms same as before)
           | inl T t           tagging (left)
           | inr T t           tagging (right)
           | case t of         case
               inl x =&gt; t
             | inr x =&gt; t

       v <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                Values
           | ...
           | inl T v           tagged value (left)
           | inr T v           tagged value (right)

       T <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                Types
           | ...
           | T + T             sum type
</pre>

<div class="paragraph"> </div>

 Reduction:

<div class="paragraph"> </div>

<center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">t<sub>1</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>1</sub>'</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_Inl) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">inl T<sub>2</sub> t<sub>1</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> inl T<sub>2</sub> t<sub>1</sub>'</td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">t<sub>2</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>2</sub>'</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_Inr) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">inr T<sub>1</sub> t<sub>2</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> inr T<sub>1</sub> t<sub>2</sub>'</td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">t<sub>0</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>0</sub>'</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_Case) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">case t<sub>0</sub> of inl x<sub>1</sub> => t<sub>1</sub> | inr x<sub>2</sub> => t<sub>2</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></td>
  <td></td>
</td>
<tr class="infruleassumption">
  <td class="infrule">case t<sub>0</sub>' of inl x<sub>1</sub> => t<sub>1</sub> | inr x<sub>2</sub> => t<sub>2</sub></td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">&nbsp;&nbsp;</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_CaseInl) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">case (inl T<sub>2</sub> v<sub>1</sub>) of inl x<sub>1</sub> => t<sub>1</sub> | inr x<sub>2</sub> => t<sub>2</sub></td>
  <td></td>
</td>
<tr class="infruleassumption">
  <td class="infrule"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>  [x<sub>1</sub>:=v<sub>1</sub>]t<sub>1</sub></td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">&nbsp;&nbsp;</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_CaseInr) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">case (inr T<sub>1</sub> v<sub>2</sub>) of inl x<sub>1</sub> => t<sub>1</sub> | inr x<sub>2</sub> => t<sub>2</sub></td>
  <td></td>
</td>
<tr class="infruleassumption">
  <td class="infrule"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>  [x<sub>2</sub>:=v<sub>2</sub>]t<sub>2</sub></td>
  <td></td>
</td>
</table></center>
<div class="paragraph"> </div>

 Typing:
<center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>1</sub> &#x2208; T<sub>1</sub></td>
  <td class="infrulenamecol" rowspan="3">
    (T_Inl) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; inl T<sub>2</sub> t<sub>1</sub> &#x2208; T<sub>1</sub> + T<sub>2</sub></td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>2</sub> &#x2208; T<sub>2</sub></td>
  <td class="infrulenamecol" rowspan="3">
    (T_Inr) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; inr T<sub>1</sub> t<sub>2</sub> &#x2208; T<sub>1</sub> + T<sub>2</sub></td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>0</sub> &#x2208; T<sub>1</sub>+T<sub>2</sub></td>
  <td></td>
</td>
<tr class="infruleassumption">
  <td class="infrule">x<sub>1</sub><span class="nowrap"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>&#x22A2;</span><span style='font-size:90%;'>&gt;</span></span></span></span></span>T<sub>1</sub>; Gamma &#x22A2; t<sub>1</sub> &#x2208; T<sub>3</sub></td>
  <td></td>
</td>
<tr class="infruleassumption">
  <td class="infrule">x<sub>2</sub><span class="nowrap"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>&#x22A2;</span><span style='font-size:90%;'>&gt;</span></span></span></span></span>T<sub>2</sub>; Gamma &#x22A2; t<sub>2</sub> &#x2208; T<sub>3</sub></td>
  <td class="infrulenamecol" rowspan="3">
    (T_Case) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; case t<sub>0</sub> of inl x<sub>1</sub> => t<sub>1</sub> | inr x<sub>2</sub> => t<sub>2</sub> &#x2208; T<sub>3</sub></td>
  <td></td>
</td>
</table></center>
<div class="paragraph"> </div>

    We use the type annotations on <span class="inlinecode"><span class="id" title="var">inl</span></span> and <span class="inlinecode"><span class="id" title="var">inr</span></span> to make the typing
    relation deterministic (each term has at most one type), as we
    did for functions. 
<div class="paragraph"> </div>

 Without this extra information, the typing rule <span class="inlinecode"><span class="id" title="var">T_Inl</span></span>, for
    example, would have to say that, once we have shown that <span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span> is
    an element of type <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span>, we can derive that <span class="inlinecode"><span class="id" title="var">inl</span></span> <span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span> is an element
    of <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span> <span class="inlinecode">+</span> <span class="inlinecode"><span class="id" title="var">T<sub>2</sub></span></span> for <i>any</i> type <span class="inlinecode"><span class="id" title="var">T<sub>2</sub></span></span>.  For example, we could derive both
    <span class="inlinecode"><span class="id" title="var">inl</span></span> <span class="inlinecode">5</span> <span class="inlinecode">:</span> <span class="inlinecode"><span class="id" title="var">Nat</span></span> <span class="inlinecode">+</span> <span class="inlinecode"><span class="id" title="var">Nat</span></span> and <span class="inlinecode"><span class="id" title="var">inl</span></span> <span class="inlinecode">5</span> <span class="inlinecode">:</span> <span class="inlinecode"><span class="id" title="var">Nat</span></span> <span class="inlinecode">+</span> <span class="inlinecode"><span class="id" title="var">Bool</span></span> (and infinitely many
    other types).  This peculiarity (technically, a failure of
    uniqueness of types) would mean that we cannot build a
    typechecking algorithm simply by "reading the rules from bottom to
    top" as we could for all the other features seen so far.

<div class="paragraph"> </div>

    There are various ways to deal with this difficulty.  One simple
    one -- which we've adopted here -- forces the programmer to
    explicitly annotate the "other side" of a sum type when performing
    an injection.  This is a bit heavy for programmers (so real
    languages adopt other solutions), but it is easy to understand and
    formalize. 
<div class="paragraph"> </div>

<a id="lab269"></a><h2 class="section">Lists</h2>

<div class="paragraph"> </div>

 The typing features we have seen can be classified into
    <i>base types</i> like <span class="inlinecode"><span class="id" title="var">Bool</span></span>, and <i>type constructors</i> like <span class="inlinecode">→</span> and
    <span class="inlinecode">×</span> that build new types from old ones.  Another useful type
    constructor is <span class="inlinecode"><span class="id" title="var">List</span></span>.  For every type <span class="inlinecode"><span class="id" title="var">T</span></span>, the type <span class="inlinecode"><span class="id" title="var">List</span></span> <span class="inlinecode"><span class="id" title="var">T</span></span>
    describes finite-length lists whose elements are drawn from <span class="inlinecode"><span class="id" title="var">T</span></span>.

<div class="paragraph"> </div>

    In principle, we could encode lists using pairs, sums and
    <i>recursive</i> types. But giving semantics to recursive types is
    non-trivial. Instead, we'll just discuss the special case of lists
    directly.

<div class="paragraph"> </div>

    Below we give the syntax, semantics, and typing rules for lists.
    Except for the fact that explicit type annotations are mandatory
    on <span class="inlinecode"><span class="id" title="var">nil</span></span> and cannot appear on <span class="inlinecode"><span class="id" title="var">cons</span></span>, these lists are essentially
    identical to those we built in Coq.  We use <span class="inlinecode"><span class="id" title="tactic">case</span></span>, rather than
    <span class="inlinecode"><span class="id" title="var">head</span></span> and <span class="inlinecode"><span class="id" title="var">tail</span></span> operators, to destruct lists, to avoid dealing
    with questions like "what is the <span class="inlinecode"><span class="id" title="var">head</span></span> of the empty list?" 
<div class="paragraph"> </div>

 For example, here is a function that calculates the sum of
    the first two elements of a list of numbers:
<pre>
      \x:List Nat,
      case x of nil   =&gt; 0
               | a::x' =&gt; case x' of nil    =&gt; a
                                    | b::x'' =&gt; a+b
</pre>

<div class="paragraph"> </div>

    Syntax:
<pre>
       t <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                Terms
           | ...
           | nil T
           | cons t t
           | case t of nil   =&gt; t
                      | x::x =&gt; t

       v <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                Values
           | ...
           | nil T             nil value
           | cons v v          cons value

       T <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                Types
           | ...
           | List T            list of Ts
</pre>

<div class="paragraph"> </div>

 Reduction:
<center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">t<sub>1</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>1</sub>'</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_Cons1) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">cons t<sub>1</sub> t<sub>2</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> cons t<sub>1</sub>' t<sub>2</sub></td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">t<sub>2</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>2</sub>'</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_Cons2) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">cons v<sub>1</sub> t<sub>2</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> cons v<sub>1</sub> t<sub>2</sub>'</td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">t<sub>1</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>1</sub>'</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_Lcase1) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">(case t<sub>1</sub> of nil => t<sub>2</sub> | xh::xt => t<sub>3</sub>) <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></td>
  <td></td>
</td>
<tr class="infruleassumption">
  <td class="infrule">(case t<sub>1</sub>' of nil => t<sub>2</sub> | xh::xt => t<sub>3</sub>)</td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">&nbsp;&nbsp;</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_LcaseNil) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">(case nil T<sub>1</sub> of nil => t<sub>2</sub> | xh::xt => t<sub>3</sub>)</td>
  <td></td>
</td>
<tr class="infruleassumption">
  <td class="infrule"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>2</sub></td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">&nbsp;&nbsp;</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_LcaseCons) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">(case (cons vh vt) of nil => t<sub>2</sub> | xh::xt => t<sub>3</sub>)</td>
  <td></td>
</td>
<tr class="infruleassumption">
  <td class="infrule"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> [xh:=vh,xt:=vt]t<sub>3</sub></td>
  <td></td>
</td>
</table></center>
<div class="paragraph"> </div>

 Typing:
<center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">&nbsp;&nbsp;</td>
  <td class="infrulenamecol" rowspan="3">
    (T_Nil) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; nil T<sub>1</sub> &#x2208; List T<sub>1</sub></td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>1</sub> &#x2208; T<sub>1</sub>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gamma &#x22A2; t<sub>2</sub> &#x2208; List T<sub>1</sub></td>
  <td class="infrulenamecol" rowspan="3">
    (T_Cons) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; cons t<sub>1</sub> t<sub>2</sub> &#x2208; List T<sub>1</sub></td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>1</sub> &#x2208; List T<sub>1</sub></td>
  <td></td>
</td>
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>2</sub> &#x2208; T<sub>2</sub></td>
  <td></td>
</td>
<tr class="infruleassumption">
  <td class="infrule">(h<span class="nowrap"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>&#x22A2;</span><span style='font-size:90%;'>&gt;</span></span></span></span></span>T<sub>1</sub>; t<span class="nowrap"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>&#x22A2;</span><span style='font-size:90%;'>&gt;</span></span></span></span></span>List T<sub>1</sub>; Gamma) &#x22A2; t<sub>3</sub> &#x2208; T<sub>2</sub></td>
  <td class="infrulenamecol" rowspan="3">
    (T_Lcase) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; (case t<sub>1</sub> of nil => t<sub>2</sub> | h::t => t<sub>3</sub>) &#x2208; T<sub>2</sub></td>
  <td></td>
</td>
</table></center>
<div class="paragraph"> </div>

<a id="lab270"></a><h2 class="section">General Recursion</h2>

<div class="paragraph"> </div>

 Another facility found in most programming languages (including
    Coq) is the ability to define recursive functions.  For example,
    we would like to be able to define the factorial function like
    this:
<pre>
      fact = \x:Nat,
                test x=0 then 1 else x * (fact (pred x)))
</pre>
   Note that the right-hand side of this binder mentions the variable
   being bound -- something that is not allowed by our formalization of
   <span class="inlinecode"><span class="id" title="keyword">let</span></span> above.

<div class="paragraph"> </div>

   Directly formalizing this "recursive definition" mechanism is possible,
   but it requires some extra effort: in particular, we'd have to
   pass around an "environment" of recursive function definitions in
   the definition of the <span class="inlinecode"><span class="id" title="var">step</span></span> relation. 
<div class="paragraph"> </div>

 Here is another way of presenting recursive functions that is
    a bit more verbose but equally powerful and much more straightforward
    to formalize: instead of writing recursive definitions, we will define
    a <i>fixed-point operator</i> called <span class="inlinecode"><span class="id" title="keyword">fix</span></span> that performs the "unfolding"
    of the recursive definition in the right-hand side as needed, during
    reduction.

<div class="paragraph"> </div>

    For example, instead of
<pre>
      fact = \x:Nat,
                test x=0 then 1 else x * (fact (pred x)))
</pre>
    we will write:
<pre>
      fact =
          fix
            (\f:Nat<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>Nat,
               \x:Nat,
                  test x=0 then 1 else x * (f (pred x)))
</pre>
 We can derive the latter from the former as follows:

<div class="paragraph"> </div>

<ul class="doclist">
<li> In the right-hand side of the definition of <span class="inlinecode"><span class="id" title="var">fact</span></span>, replace
        recursive references to <span class="inlinecode"><span class="id" title="var">fact</span></span> by a fresh variable <span class="inlinecode"><span class="id" title="var">f</span></span>.

<div class="paragraph"> </div>


</li>
<li> Add an abstraction binding <span class="inlinecode"><span class="id" title="var">f</span></span> at the front, with an
        appropriate type annotation.  (Since we are using <span class="inlinecode"><span class="id" title="var">f</span></span> in place
        of <span class="inlinecode"><span class="id" title="var">fact</span></span>, which had type <span class="inlinecode"><span class="id" title="var">Nat</span>→<span class="id" title="var">Nat</span></span>, we should require <span class="inlinecode"><span class="id" title="var">f</span></span>
        to have the same type.)  The new abstraction has type
        <span class="inlinecode">(<span class="id" title="var">Nat</span>→<span class="id" title="var">Nat</span>)</span> <span class="inlinecode">→</span> <span class="inlinecode">(<span class="id" title="var">Nat</span>→<span class="id" title="var">Nat</span>)</span>.

<div class="paragraph"> </div>


</li>
<li> Apply <span class="inlinecode"><span class="id" title="keyword">fix</span></span> to this abstraction.  This application has
        type <span class="inlinecode"><span class="id" title="var">Nat</span>→<span class="id" title="var">Nat</span></span>.

<div class="paragraph"> </div>


</li>
<li> Use all of this as the right-hand side of an ordinary
        <span class="inlinecode"><span class="id" title="keyword">let</span></span>-binding for <span class="inlinecode"><span class="id" title="var">fact</span></span>.

</li>
</ul>

<div class="paragraph"> </div>

 The intuition is that the higher-order function <span class="inlinecode"><span class="id" title="var">f</span></span> passed
    to <span class="inlinecode"><span class="id" title="keyword">fix</span></span> is a <i>generator</i> for the <span class="inlinecode"><span class="id" title="var">fact</span></span> function: if <span class="inlinecode"><span class="id" title="var">f</span></span> is
    applied to a function that "approximates" the desired behavior of
    <span class="inlinecode"><span class="id" title="var">fact</span></span> up to some number <span class="inlinecode"><span class="id" title="var">n</span></span> (that is, a function that returns
    correct results on inputs less than or equal to <span class="inlinecode"><span class="id" title="var">n</span></span> but we don't
    care what it does on inputs greater than <span class="inlinecode"><span class="id" title="var">n</span></span>), then <span class="inlinecode"><span class="id" title="var">f</span></span> returns a
    slightly better approximation to <span class="inlinecode"><span class="id" title="var">fact</span></span> -- a function that returns
    correct results for inputs up to <span class="inlinecode"><span class="id" title="var">n</span>+1</span>.  Applying <span class="inlinecode"><span class="id" title="keyword">fix</span></span> to this
    generator returns its <i>fixed point</i>, which is a function that
    gives the desired behavior for all inputs <span class="inlinecode"><span class="id" title="var">n</span></span>.

<div class="paragraph"> </div>

    (The term "fixed point" is used here in exactly the same sense as
    in ordinary mathematics, where a fixed point of a function <span class="inlinecode"><span class="id" title="var">f</span></span> is
    an input <span class="inlinecode"><span class="id" title="var">x</span></span> such that <span class="inlinecode"><span class="id" title="var">f</span>(<span class="id" title="var">x</span>)</span> <span class="inlinecode">=</span> <span class="inlinecode"><span class="id" title="var">x</span></span>.  Here, a fixed point of a
    function <span class="inlinecode"><span class="id" title="var">F</span></span> of type <span class="inlinecode">(<span class="id" title="var">Nat</span>→<span class="id" title="var">Nat</span>)<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>(<span class="id" title="var">Nat</span>→<span class="id" title="var">Nat</span>)</span> is a function <span class="inlinecode"><span class="id" title="var">f</span></span> of
    type <span class="inlinecode"><span class="id" title="var">Nat</span>→<span class="id" title="var">Nat</span></span> such that <span class="inlinecode"><span class="id" title="var">F</span></span> <span class="inlinecode"><span class="id" title="var">f</span></span> behaves the same as <span class="inlinecode"><span class="id" title="var">f</span></span>.) 
<div class="paragraph"> </div>

 Syntax:
<pre>
       t <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                Terms
           | ...
           | fix t             fixed-point operator
</pre>
   Reduction:
<center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">t<sub>1</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>1</sub>'</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_Fix1) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">fix t<sub>1</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> fix t<sub>1</sub>'</td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">&nbsp;&nbsp;</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_FixAbs) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">fix (\xf:T<sub>1</sub>.t1) <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> [xf:=fix (\xf:T<sub>1</sub>.t1)] t<sub>1</sub></td>
  <td></td>
</td>
</table></center>   Typing:
<center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>1</sub> &#x2208; T<sub>1</sub><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>T<sub>1</sub></td>
  <td class="infrulenamecol" rowspan="3">
    (T_Fix) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; fix t<sub>1</sub> &#x2208; T<sub>1</sub></td>
  <td></td>
</td>
</table></center> 
<div class="paragraph"> </div>

 Let's see how <span class="inlinecode"><span class="id" title="var">ST_FixAbs</span></span> works by reducing <span class="inlinecode"><span class="id" title="var">fact</span></span> <span class="inlinecode">3</span> <span class="inlinecode">=</span> <span class="inlinecode"><span class="id" title="keyword">fix</span></span> <span class="inlinecode"><span class="id" title="var">F</span></span> <span class="inlinecode">3</span>,
    where
<pre>
    F = (\f. \x. test x=0 then 1 else x * (f (pred x)))
</pre>
    (type annotations are omitted for brevity).
<pre>
    fix F 3
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_FixAbs</span></span> + <span class="inlinecode"><span class="id" title="var">ST_App1</span></span>
<pre>
    (\x. test x=0 then 1 else x * (fix F (pred x))) 3
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_AppAbs</span></span>
<pre>
    test 3=0 then 1 else 3 * (fix F (pred 3))
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_Test0_Nonzero</span></span>
<pre>
    3 * (fix F (pred 3))
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_FixAbs</span></span> <span class="inlinecode">+</span> <span class="inlinecode"><span class="id" title="var">ST_Mult2</span></span>
<pre>
    3 * ((\x. test x=0 then 1 else x * (fix F (pred x))) (pred 3))
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_PredNat</span></span> <span class="inlinecode">+</span> <span class="inlinecode"><span class="id" title="var">ST_Mult2</span></span> <span class="inlinecode">+</span> <span class="inlinecode"><span class="id" title="var">ST_App2</span></span>
<pre>
    3 * ((\x. test x=0 then 1 else x * (fix F (pred x))) 2)
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_AppAbs</span></span> <span class="inlinecode">+</span> <span class="inlinecode"><span class="id" title="var">ST_Mult2</span></span>
<pre>
    3 * (test 2=0 then 1 else 2 * (fix F (pred 2)))
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_Test0_Nonzero</span></span> <span class="inlinecode">+</span> <span class="inlinecode"><span class="id" title="var">ST_Mult2</span></span>
<pre>
    3 * (2 * (fix F (pred 2)))
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_FixAbs</span></span> <span class="inlinecode">+</span> <span class="inlinecode">2</span> <span class="inlinecode"><span class="id" title="var">x</span></span> <span class="inlinecode"><span class="id" title="var">ST_Mult2</span></span>
<pre>
    3 * (2 * ((\x. test x=0 then 1 else x * (fix F (pred x))) (pred 2)))
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_PredNat</span></span> <span class="inlinecode">+</span> <span class="inlinecode">2</span> <span class="inlinecode"><span class="id" title="var">x</span></span> <span class="inlinecode"><span class="id" title="var">ST_Mult2</span></span> <span class="inlinecode">+</span> <span class="inlinecode"><span class="id" title="var">ST_App2</span></span>
<pre>
    3 * (2 * ((\x. test x=0 then 1 else x * (fix F (pred x))) 1))
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_AppAbs</span></span> <span class="inlinecode">+</span> <span class="inlinecode">2</span> <span class="inlinecode"><span class="id" title="var">x</span></span> <span class="inlinecode"><span class="id" title="var">ST_Mult2</span></span>
<pre>
    3 * (2 * (test 1=0 then 1 else 1 * (fix F (pred 1))))
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_Test0_Nonzero</span></span> <span class="inlinecode">+</span> <span class="inlinecode">2</span> <span class="inlinecode"><span class="id" title="var">x</span></span> <span class="inlinecode"><span class="id" title="var">ST_Mult2</span></span>
<pre>
    3 * (2 * (1 * (fix F (pred 1))))
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_FixAbs</span></span> <span class="inlinecode">+</span> <span class="inlinecode">3</span> <span class="inlinecode"><span class="id" title="var">x</span></span> <span class="inlinecode"><span class="id" title="var">ST_Mult2</span></span>
<pre>
    3 * (2 * (1 * ((\x. test x=0 then 1 else x * (fix F (pred x))) (pred 1))))
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_PredNat</span></span> <span class="inlinecode">+</span> <span class="inlinecode">3</span> <span class="inlinecode"><span class="id" title="var">x</span></span> <span class="inlinecode"><span class="id" title="var">ST_Mult2</span></span> <span class="inlinecode">+</span> <span class="inlinecode"><span class="id" title="var">ST_App2</span></span>
<pre>
    3 * (2 * (1 * ((\x. test x=0 then 1 else x * (fix F (pred x))) 0)))
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_AppAbs</span></span> <span class="inlinecode">+</span> <span class="inlinecode">3</span> <span class="inlinecode"><span class="id" title="var">x</span></span> <span class="inlinecode"><span class="id" title="var">ST_Mult2</span></span>
<pre>
    3 * (2 * (1 * (test 0=0 then 1 else 0 * (fix F (pred 0)))))
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_Test0Zero</span></span> <span class="inlinecode">+</span> <span class="inlinecode">3</span> <span class="inlinecode"><span class="id" title="var">x</span></span> <span class="inlinecode"><span class="id" title="var">ST_Mult2</span></span>
<pre>
    3 * (2 * (1 * 1))
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_MultNats</span></span> <span class="inlinecode">+</span> <span class="inlinecode">2</span> <span class="inlinecode"><span class="id" title="var">x</span></span> <span class="inlinecode"><span class="id" title="var">ST_Mult2</span></span>
<pre>
    3 * (2 * 1)
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_MultNats</span></span> <span class="inlinecode">+</span> <span class="inlinecode"><span class="id" title="var">ST_Mult2</span></span>
<pre>
    3 * 2
</pre>
<span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">ST_MultNats</span></span>
<pre>
    6
</pre>

<div class="paragraph"> </div>

 One important point to note is that, unlike <span class="inlinecode"><span class="id" title="keyword">Fixpoint</span></span>
    definitions in Coq, there is nothing to prevent functions defined
    using <span class="inlinecode"><span class="id" title="keyword">fix</span></span> from diverging. 
<div class="paragraph"> </div>

<a id="lab271"></a><h4 class="section">Exercise: 1 star, standard, optional (halve_fix)</h4>
 Translate this informal recursive definition into one using <span class="inlinecode"><span class="id" title="keyword">fix</span></span>:
<pre>
      halve =
        \x:Nat,
           test x=0 then 0
           else test (pred x)=0 then 0
           else 1 + (halve (pred (pred x)))
</pre>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
 <font size=-2>&#9744;</font> 
<div class="paragraph"> </div>

<a id="lab272"></a><h4 class="section">Exercise: 1 star, standard, optional (fact_steps)</h4>
 Write down the sequence of steps that the term <span class="inlinecode"><span class="id" title="var">fact</span></span> <span class="inlinecode">1</span> goes
    through to reduce to a normal form (assuming the usual reduction
    rules for arithmetic operations).

<div class="paragraph"> </div>

    <span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
 <font size=-2>&#9744;</font> 
<div class="paragraph"> </div>

 The ability to form the fixed point of a function of type <span class="inlinecode"><span class="id" title="var">T</span>→<span class="id" title="var">T</span></span>
    for any <span class="inlinecode"><span class="id" title="var">T</span></span> has some surprising consequences.  In particular, it
    implies that <i>every</i> type is inhabited by some term.  To see this,
    observe that, for every type <span class="inlinecode"><span class="id" title="var">T</span></span>, we can define the term
<br/>
<span class="inlinecode">&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">fix</span> (\<span class="id" title="var">x</span>:<span class="id" title="var">T</span>,<span class="id" title="var">x</span>)
<div class="paragraph"> </div>

</span>    By <span class="inlinecode"><span class="id" title="var">T_Fix</span></span>  and <span class="inlinecode"><span class="id" title="var">T_Abs</span></span>, this term has type <span class="inlinecode"><span class="id" title="var">T</span></span>.  By <span class="inlinecode"><span class="id" title="var">ST_FixAbs</span></span>
    it reduces to itself, over and over again.  Thus it is a
    <i>diverging element</i> of <span class="inlinecode"><span class="id" title="var">T</span></span>.

<div class="paragraph"> </div>

    More usefully, here's an example using <span class="inlinecode"><span class="id" title="keyword">fix</span></span> to define a
    two-argument recursive function:
<pre>
    equal =
      fix
        (\eq:Nat<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>Nat<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>Bool,
           \m:Nat, \n:Nat,
             test m=0 then iszero n
             else test n=0 then fls
             else eq (pred m) (pred n))
</pre>
 And finally, here is an example where <span class="inlinecode"><span class="id" title="keyword">fix</span></span> is used to define a
    <i>pair</i> of recursive functions (illustrating the fact that the type
    <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span> in the rule <span class="inlinecode"><span class="id" title="var">T_Fix</span></span> need not be a function type):
<pre>
      evenodd =
        fix
          (\eo: (Nat<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>Bool * Nat<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>Bool),
             let e = \n:Nat, test n=0 then tru else eo,snd (pred n) in
             let o = \n:Nat, test n=0 then fls else eo,fst (pred n) in
             (e,o))

      even = evenodd.fst
      odd  = evenodd.snd
</pre>

</div>

<div class="doc">
<a id="lab273"></a><h2 class="section">Records</h2>

<div class="paragraph"> </div>

 As a final example of a basic extension of the STLC, let's look
    briefly at how to define <i>records</i> and their types.  Intuitively,
    records can be obtained from pairs by two straightforward
    generalizations: they are n-ary (rather than just binary) and
    their fields are accessed by <i>label</i> (rather than position). 
<div class="paragraph"> </div>

 Syntax:
<pre>
       t <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                          Terms
           | ...
           | {i<sub>1</sub>=t<sub>1</sub>, ..., in=tn}         record
           | t.i                         projection

       v <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                          Values
           | ...
           | {i<sub>1</sub>=v<sub>1</sub>, ..., in=vn}         record value

       T <span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>:</span>:</span>=</span>                          Types
           | ...
           | {i<sub>1</sub>:T<sub>1</sub>, ..., in:Tn}         record type
</pre>

<div class="paragraph"> </div>

 The generalization from products should be pretty obvious.  But
   it's worth noticing the ways in which what we've actually written is
   even <i>more</i> informal than the informal syntax we've used in previous
   sections and chapters: we've used "<span class="inlinecode">...</span>" in several places to mean "any
   number of these," and we've omitted explicit mention of the usual
   side condition that the labels of a record should not contain any
   repetitions. 
<div class="paragraph"> </div>


<div class="paragraph"> </div>

   Reduction:
<center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">ti <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> ti'</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_Rcd) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">{i<sub>1</sub>=v<sub>1</sub>, ..., im=vm, in=ti , ...}</td>
  <td></td>
</td>
<tr class="infruleassumption">
  <td class="infrule"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> {i<sub>1</sub>=v<sub>1</sub>, ..., im=vm, in=ti', ...}</td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">t<sub>0</sub> <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>0</sub>'</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_Proj1) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">t<sub>0</sub>.i <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t<sub>0</sub>'.i</td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">&nbsp;&nbsp;</td>
  <td class="infrulenamecol" rowspan="3">
    (ST_ProjRcd) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">{..., i=vi, ...}.i <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> vi</td>
  <td></td>
</td>
</table></center> Again, these rules are a bit informal.  For example, the first rule
   is intended to be read "if <span class="inlinecode"><span class="id" title="var">ti</span></span> is the leftmost field that is not a
   value and if <span class="inlinecode"><span class="id" title="var">ti</span></span> steps to <span class="inlinecode"><span class="id" title="var">ti'</span></span>, then the whole record steps..."
   In the last rule, the intention is that there should be only one
   field called <span class="inlinecode"><span class="id" title="var">i</span></span>, and that all the other fields must contain values. 
<div class="paragraph"> </div>


<div class="paragraph"> </div>

   The typing rules are also simple:
<center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>1</sub> &#x2208; T<sub>1</sub>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gamma &#x22A2; tn &#x2208; Tn</td>
  <td class="infrulenamecol" rowspan="3">
    (T_Rcd) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; {i<sub>1</sub>=t<sub>1</sub>, ..., in=tn} &#x2208; {i<sub>1</sub>:T<sub>1</sub>, ..., in:Tn}</td>
  <td></td>
</td>
</table></center><center><table class="infrule">
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>0</sub> &#x2208; {..., i:Ti, ...}</td>
  <td class="infrulenamecol" rowspan="3">
    (T_Proj) &nbsp;
  </td></tr>
<tr class="infrulemiddle">
  <td class="infrule"><hr /></td>
</tr>
<tr class="infruleassumption">
  <td class="infrule">Gamma &#x22A2; t<sub>0</sub>.i &#x2208; Ti</td>
  <td></td>
</td>
</table></center>
<div class="paragraph"> </div>

 There are several ways to approach formalizing the above
    definitions.

<div class="paragraph"> </div>

<ul class="doclist">
<li> We can directly formalize the syntactic forms and inference
        rules, staying as close as possible to the form we've given
        them above.  This is conceptually straightforward, and it's
        probably what we'd want to do if we were building a real
        compiler (in particular, it will allow us to print error
        messages in the form that programmers will find easy to
        understand).  But the formal versions of the rules will not be
        very pretty or easy to work with, because all the <span class="inlinecode">...</span>s above
        will have to be replaced with explicit quantifications or
        comprehensions.  For this reason, records are not included in
        the extended exercise at the end of this chapter.  (It is
        still useful to discuss them informally here because they will
        help motivate the addition of subtyping to the type system
        when we get to the <a href="Sub.html"><span class="inlineref">Sub</span></a> chapter.)

<div class="paragraph"> </div>


</li>
<li> Alternatively, we could look for a smoother way of presenting
        records -- for example, a binary presentation with one
        constructor for the empty record and another constructor for
        adding a single field to an existing record, instead of a
        single monolithic constructor that builds a whole record at
        once.  This is the right way to go if we are primarily
        interested in studying the metatheory of the calculi with
        records, since it leads to clean and elegant definitions and
        proofs.  Chapter <a href="Records.html"><span class="inlineref">Records</span></a> shows how this can be done.

<div class="paragraph"> </div>


</li>
<li> Finally, if we like, we can avoid formalizing records
        altogether, by stipulating that record notations are just
        informal shorthands for more complex expressions involving
        pairs and product types.  We sketch this approach in the next
        section. 
</li>
</ul>

</div>

<div class="doc">
<a id="lab274"></a><h3 class="section">Encoding Records (Optional)</h3>

<div class="paragraph"> </div>

 Let's see how records can be encoded using just pairs and
    <span class="inlinecode"><span class="id" title="var">unit</span></span>.  (This clever encoding, as well as the observation that it
    also extends to systems with subtyping, is due to Luca Cardelli.)

<div class="paragraph"> </div>

    First, observe that we can encode arbitrary-size <i>tuples</i> using
    nested pairs and the <span class="inlinecode"><span class="id" title="var">unit</span></span> value.  To avoid overloading the pair
    notation <span class="inlinecode">(<span class="id" title="var">t<sub>1</sub></span>,<span class="id" title="var">t<sub>2</sub></span>)</span>, we'll use curly braces without labels to write
    down tuples, so <span class="inlinecode">{}</span> is the empty tuple, <span class="inlinecode">{5}</span> is a singleton
    tuple, <span class="inlinecode">{5,6}</span> is a 2-tuple (morally the same as a pair),
    <span class="inlinecode">{5,6,7}</span> is a triple, etc.
<pre>
      {} --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> unit {t<sub>1</sub>, t<sub>2</sub>, ..., tn} --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> (t<sub>1</sub>, trest) where {t<sub>2</sub>,
      ..., tn} --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> trest
</pre>
    Similarly, we can encode tuple types using nested product types:
<pre>
      {} --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> Unit {T<sub>1</sub>, T<sub>2</sub>, ..., Tn} --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> T<sub>1</sub> * TRest where {T<sub>2</sub>, ...,
      Tn} --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> TRest
</pre>
    The operation of projecting a field from a tuple can be encoded
    using a sequence of second projections followed by a first
    projection:
<pre>
      t.0 --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t.fst t.(n+1) --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> (t.snd).n
</pre>
    Next, suppose that there is some total ordering on record labels,
    so that we can associate each label with a unique natural number.
    This number is called the <i>position</i> of the label.  For example,
    we might assign positions like this:
<pre>
      LABEL POSITION a 0 b 1 c 2 ...  ...  bar 1395 ...  ...  foo 4460
      ...  ...
</pre>
    We use these positions to encode record values as tuples (i.e., as
    nested pairs) by sorting the fields according to their positions.
    For example:
<pre>
      {a=5,b=6} --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> {5,6} {a=5,c=7} --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> {5,unit,7} {c=7,a=5} --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>
      {5,unit,7} {c=5,b=3} --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> {unit,3,5} {f=8,c=5,a=7} --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>
      {7,unit,5,unit,unit,8} {f=8,c=5} --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> {unit,unit,5,unit,unit,8}
</pre>
    Note that each field appears in the position associated with its
    label, that the size of the tuple is determined by the label with
    the highest position, and that we fill in unused positions with
    <span class="inlinecode"><span class="id" title="var">unit</span></span>.

<div class="paragraph"> </div>

    We do exactly the same thing with record types:
<pre>
      {a:Nat,b:Nat} --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> {Nat,Nat} {c:Nat,a:Nat} --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> {Nat,Unit,Nat}
      {f:Nat,c:Nat} --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> {Unit,Unit,Nat,Unit,Unit,Nat}
</pre>
    Finally, record projection is encoded as a tuple projection from
    the appropriate position:
<pre>
      t.l --<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t.(position of l)
</pre>
    It is not hard to check that all the typing rules for the original
    "direct" presentation of records are validated by this
    encoding.  (The reduction rules are "almost validated" -- not
    quite, because the encoding reorders fields.) 
<div class="paragraph"> </div>

 Of course, this encoding will not be very efficient if we
    happen to use a record with label <span class="inlinecode"><span class="id" title="var">foo</span></span>!  But things are not
    actually as bad as they might seem: for example, if we assume that
    our compiler can see the whole program at the same time, we can
    <i>choose</i> the numbering of labels so that we assign small positions
    to the most frequently used labels.  Indeed, there are industrial
    compilers that essentially do this! 
<div class="paragraph"> </div>

<a id="lab275"></a><h3 class="section">Variants (Optional)</h3>

<div class="paragraph"> </div>

 Just as products can be generalized to records, sums can be
    generalized to n-ary labeled types called <i>variants</i>.  Instead of
    <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span>+<span class="id" title="var">T<sub>2</sub></span></span>, we can write something like <span class="inlinecode">&lt;<span class="id" title="var">l<sub>1</sub></span>:<span class="id" title="var">T<sub>1</sub></span>,<span class="id" title="var">l<sub>2</sub></span>:<span class="id" title="var">T<sub>2</sub></span>,...<span class="id" title="var">ln</span>:<span class="id" title="var">Tn</span>&gt;</span>
    where <span class="inlinecode"><span class="id" title="var">l<sub>1</sub></span></span>,<span class="inlinecode"><span class="id" title="var">l<sub>2</sub></span></span>,... are field labels which are used both to build
    instances and as case arm labels.

<div class="paragraph"> </div>

    These n-ary variants give us almost enough mechanism to build
    arbitrary inductive data types like lists and trees from
    scratch -- the only thing missing is a way to allow <i>recursion</i> in
    type definitions.  We won't cover this here, but detailed
    treatments can be found in many textbooks -- e.g., Types and
    Programming Languages <a href="Bib.html#Pierce-2002"><span class="inlineref">[Pierce 2002]</span></a>. 
</div>

<div class="doc">
<a id="lab276"></a><h1 class="section">Exercise: Formalizing the Extensions</h1>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Module</span> <a id="STLCExtended" class="idref" href="#STLCExtended"><span class="id" title="module">STLCExtended</span></a>.<br/>
</div>

<div class="doc">
<a id="lab277"></a><h4 class="section">Exercise: 3 stars, standard (STLCE_definitions)</h4>
 In this series of exercises, you will formalize some of the
    extensions described in this chapter.  We've provided the
    necessary additions to the syntax of terms and types, and we've
    included a few examples that you can test your definitions with
    to make sure they are working as expected.  You'll fill in the
    rest of the definitions and extend all the proofs accordingly.

<div class="paragraph"> </div>

    To get you started, we've provided implementations for:
<ul class="doclist">
<li> numbers

</li>
<li> sums

</li>
<li> lists

</li>
<li> unit

</li>
</ul>

<div class="paragraph"> </div>

    You need to complete the implementations for:
<ul class="doclist">
<li> pairs

</li>
<li> let (which involves binding)

</li>
<li> <span class="inlinecode"><span class="id" title="keyword">fix</span></span>

</li>
</ul>

<div class="paragraph"> </div>

    A good strategy is to work on the extensions one at a time, in two
    passes, rather than trying to work through the file from start to
    finish in a single pass.  For each definition or proof, begin by
    reading carefully through the parts that are provided for you,
    referring to the text in the <a href="Stlc.html"><span class="inlineref">Stlc</span></a> chapter for high-level
    intuitions and the embedded comments for detailed mechanics. 
</div>

<div class="doc">
<a id="lab278"></a><h3 class="section">Syntax</h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Inductive</span> <a id="STLCExtended.ty" class="idref" href="#STLCExtended.ty"><span class="id" title="inductive">ty</span></a> : <span class="id" title="keyword">Type</span> :=<br/>
&nbsp;&nbsp;| <a id="STLCExtended.Ty_Arrow" class="idref" href="#STLCExtended.Ty_Arrow"><span class="id" title="constructor">Ty_Arrow</span></a> : <a class="idref" href="MoreStlc.html#ty:1"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#ty:1"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#ty:1"><span class="id" title="inductive">ty</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.Ty_Nat" class="idref" href="#STLCExtended.Ty_Nat"><span class="id" title="constructor">Ty_Nat</span></a>  : <a class="idref" href="MoreStlc.html#ty:1"><span class="id" title="inductive">ty</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.Ty_Sum" class="idref" href="#STLCExtended.Ty_Sum"><span class="id" title="constructor">Ty_Sum</span></a>  : <a class="idref" href="MoreStlc.html#ty:1"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#ty:1"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#ty:1"><span class="id" title="inductive">ty</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.Ty_List" class="idref" href="#STLCExtended.Ty_List"><span class="id" title="constructor">Ty_List</span></a> : <a class="idref" href="MoreStlc.html#ty:1"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#ty:1"><span class="id" title="inductive">ty</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.Ty_Unit" class="idref" href="#STLCExtended.Ty_Unit"><span class="id" title="constructor">Ty_Unit</span></a> : <a class="idref" href="MoreStlc.html#ty:1"><span class="id" title="inductive">ty</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.Ty_Prod" class="idref" href="#STLCExtended.Ty_Prod"><span class="id" title="constructor">Ty_Prod</span></a> : <a class="idref" href="MoreStlc.html#ty:1"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#ty:1"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#ty:1"><span class="id" title="inductive">ty</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Inductive</span> <a id="STLCExtended.tm" class="idref" href="#STLCExtended.tm"><span class="id" title="inductive">tm</span></a> : <span class="id" title="keyword">Type</span> :=<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;pure&nbsp;STLC&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_var" class="idref" href="#STLCExtended.tm_var"><span class="id" title="constructor">tm_var</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_app" class="idref" href="#STLCExtended.tm_app"><span class="id" title="constructor">tm_app</span></a> : <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_abs" class="idref" href="#STLCExtended.tm_abs"><span class="id" title="constructor">tm_abs</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.ty"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;numbers&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_const" class="idref" href="#STLCExtended.tm_const"><span class="id" title="constructor">tm_const</span></a>: <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nat"><span class="id" title="inductive">nat</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_succ" class="idref" href="#STLCExtended.tm_succ"><span class="id" title="constructor">tm_succ</span></a> : <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_pred" class="idref" href="#STLCExtended.tm_pred"><span class="id" title="constructor">tm_pred</span></a> : <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_mult" class="idref" href="#STLCExtended.tm_mult"><span class="id" title="constructor">tm_mult</span></a> : <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_if<sub>0</sub>" class="idref" href="#STLCExtended.tm_if<sub>0</sub>"><span class="id" title="constructor">tm_if<sub>0</sub></span></a>  : <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;sums&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_inl" class="idref" href="#STLCExtended.tm_inl"><span class="id" title="constructor">tm_inl</span></a> : <a class="idref" href="MoreStlc.html#STLCExtended.ty"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_inr" class="idref" href="#STLCExtended.tm_inr"><span class="id" title="constructor">tm_inr</span></a> : <a class="idref" href="MoreStlc.html#STLCExtended.ty"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_case" class="idref" href="#STLCExtended.tm_case"><span class="id" title="constructor">tm_case</span></a> : <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;i.e.,&nbsp;<span class="inlinecode"><span class="id" title="tactic">case</span></span> <span class="inlinecode"><span class="id" title="var">t<sub>0</sub></span></span> <span class="inlinecode"><span class="id" title="keyword">of</span></span> <span class="inlinecode"><span class="id" title="var">inl</span></span> <span class="inlinecode"><span class="id" title="var">x<sub>1</sub></span></span> <span class="inlinecode">⇒</span> <span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span> <span class="inlinecode">|</span> <span class="inlinecode"><span class="id" title="var">inr</span></span> <span class="inlinecode"><span class="id" title="var">x<sub>2</sub></span></span> <span class="inlinecode">⇒</span> <span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span>&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;lists&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_nil" class="idref" href="#STLCExtended.tm_nil"><span class="id" title="constructor">tm_nil</span></a> : <a class="idref" href="MoreStlc.html#STLCExtended.ty"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_cons" class="idref" href="#STLCExtended.tm_cons"><span class="id" title="constructor">tm_cons</span></a> : <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_lcase" class="idref" href="#STLCExtended.tm_lcase"><span class="id" title="constructor">tm_lcase</span></a> : <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;i.e.,&nbsp;<span class="inlinecode"><span class="id" title="tactic">case</span></span> <span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span> <span class="inlinecode"><span class="id" title="keyword">of</span></span> <span class="inlinecode">|</span> <span class="inlinecode"><span class="id" title="var">nil</span></span> <span class="inlinecode">⇒</span> <span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span> <span class="inlinecode">|</span> <span class="inlinecode"><span class="id" title="var">x</span>::<span class="id" title="var">y</span></span> <span class="inlinecode">⇒</span> <span class="inlinecode"><span class="id" title="var">t<sub>3</sub></span></span>&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;unit&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_unit" class="idref" href="#STLCExtended.tm_unit"><span class="id" title="constructor">tm_unit</span></a> : <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;You&nbsp;are&nbsp;going&nbsp;to&nbsp;be&nbsp;working&nbsp;on&nbsp;the&nbsp;following&nbsp;extensions:&nbsp;*)</span><br/>
<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;pairs&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_pair" class="idref" href="#STLCExtended.tm_pair"><span class="id" title="constructor">tm_pair</span></a> : <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_fst" class="idref" href="#STLCExtended.tm_fst"><span class="id" title="constructor">tm_fst</span></a> : <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_snd" class="idref" href="#STLCExtended.tm_snd"><span class="id" title="constructor">tm_snd</span></a> : <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;let&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_let" class="idref" href="#STLCExtended.tm_let"><span class="id" title="constructor">tm_let</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;i.e.,&nbsp;<span class="inlinecode"><span class="id" title="keyword">let</span></span> <span class="inlinecode"><span class="id" title="var">x</span></span> <span class="inlinecode">=</span> <span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span> <span class="inlinecode"><span class="id" title="tactic">in</span></span> <span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span>&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;fix&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.tm_fix" class="idref" href="#STLCExtended.tm_fix"><span class="id" title="constructor">tm_fix</span></a>  : <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#tm:3"><span class="id" title="inductive">tm</span></a>.<br/>
</div>

<div class="doc">
Note that, for brevity, we've omitted booleans and instead
    provided a single <span class="inlinecode"><span class="id" title="var">if<sub>0</sub></span></span> form combining a zero test and a
    conditional.  That is, instead of writing
<pre>
       if x = 0 then ... else ...
</pre>
    we'll write this:
<pre>
       if<sub>0</sub> x then ... else ...
</pre>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.x" class="idref" href="#STLCExtended.x"><span class="id" title="definition">x</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> := "x".<br/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.y" class="idref" href="#STLCExtended.y"><span class="id" title="definition">y</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> := "y".<br/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.z" class="idref" href="#STLCExtended.z"><span class="id" title="definition">z</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> := "z".<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Hint Unfold</span> <a class="idref" href="MoreStlc.html#STLCExtended.x"><span class="id" title="definition">x</span></a> : <span class="id" title="var">core</span>.<br/>
<span class="id" title="keyword">Hint Unfold</span> <a class="idref" href="MoreStlc.html#STLCExtended.y"><span class="id" title="definition">y</span></a> : <span class="id" title="var">core</span>.<br/>
<span class="id" title="keyword">Hint Unfold</span> <a class="idref" href="MoreStlc.html#STLCExtended.z"><span class="id" title="definition">z</span></a> : <span class="id" title="var">core</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="var">Declare</span> <span class="id" title="var">Custom</span> <span class="id" title="var">Entry</span> <span class="id" title="var">stlc_ty</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id="9593265f23640347d8baf3ded78adc0e" class="idref" href="#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&quot;</span></a>&lt;{ e }&gt;" := <span class="id" title="var">e</span> (<span class="id" title="var">e</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99).<br/>
<span class="id" title="keyword">Notation</span> <a id="4790eac4da69227166d84a2e2fa965df" class="idref" href="#4790eac4da69227166d84a2e2fa965df"><span class="id" title="notation">&quot;</span></a>&lt;<span style='letter-spacing:-.4em;'>{</span>{ e <span style='letter-spacing:-.4em;'>}</span>}&gt;" := <span class="id" title="var">e</span> (<span class="id" title="var">e</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99).<br/>
<span class="id" title="keyword">Notation</span> <a id="12c502a9ec79bd3b5587ea74d3c86fae" class="idref" href="#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">&quot;</span></a>( x )" := <span class="id" title="var">x</span> (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span>, <span class="id" title="var">x</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99).<br/>
<span class="id" title="keyword">Notation</span> <a id="ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>" class="idref" href="#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">&quot;</span></a>( x )" := <span class="id" title="var">x</span> (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span>, <span class="id" title="var">x</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99).<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc::x" class="idref" href="#STLCExtended.:stlc::x"><span class="id" title="notation">&quot;</span></a>x" := <span class="id" title="var">x</span> (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0, <span class="id" title="var">x</span> <span class="id" title="keyword">constr</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc_ty::x" class="idref" href="#STLCExtended.:stlc_ty::x"><span class="id" title="notation">&quot;</span></a>x" := <span class="id" title="var">x</span> (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0, <span class="id" title="var">x</span> <span class="id" title="keyword">constr</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc_ty::x_'-&gt;'_x" class="idref" href="#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">&quot;</span></a>S <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> T" := (<a class="idref" href="MoreStlc.html#STLCExtended.Ty_Arrow"><span class="id" title="constructor">Ty_Arrow</span></a> <span class="id" title="var">S</span> <span class="id" title="var">T</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 50, <span class="id" title="tactic">right</span> <span class="id" title="keyword">associativity</span>).<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc::x_x" class="idref" href="#STLCExtended.:stlc::x_x"><span class="id" title="notation">&quot;</span></a>x y" := (<a class="idref" href="MoreStlc.html#STLCExtended.tm_app"><span class="id" title="constructor">tm_app</span></a> <span class="id" title="var">x</span> <span class="id" title="var">y</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 1, <span class="id" title="tactic">left</span> <span class="id" title="keyword">associativity</span>).<br/>
<span class="id" title="keyword">Notation</span> <a id="1ad52bf8598c9e0c39505628d95be60b" class="idref" href="#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">&quot;</span></a>\ x : t , y" :=<br/>
&nbsp;&nbsp;(<a class="idref" href="MoreStlc.html#STLCExtended.tm_abs"><span class="id" title="constructor">tm_abs</span></a> <span class="id" title="var">x</span> <span class="id" title="var">t</span> <span class="id" title="var">y</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 90, <span class="id" title="var">x</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">t</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">y</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">left</span> <span class="id" title="keyword">associativity</span>).<br/>
<span class="id" title="keyword">Coercion</span> <a class="idref" href="MoreStlc.html#STLCExtended.tm_var"><span class="id" title="constructor">tm_var</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.tm_var"><span class="id" title="constructor">:</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.tm_var"><span class="id" title="constructor">string</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.tm_var"><span class="id" title="constructor">&gt;<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.tm_var"><span class="id" title="constructor">tm</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id="10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>" class="idref" href="#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">&quot;</span></a>{ x }" := <span class="id" title="var">x</span> (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 1, <span class="id" title="var">x</span> <span class="id" title="keyword">constr</span>).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc_ty::'Nat'" class="idref" href="#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">&quot;</span></a>'Nat'" := <a class="idref" href="MoreStlc.html#STLCExtended.Ty_Nat"><span class="id" title="constructor">Ty_Nat</span></a> (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc::'succ'_x" class="idref" href="#STLCExtended.:stlc::'succ'_x"><span class="id" title="notation">&quot;</span></a>'succ' x" := (<a class="idref" href="MoreStlc.html#STLCExtended.tm_succ"><span class="id" title="constructor">tm_succ</span></a> <span class="id" title="var">x</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">x</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc::'pred'_x" class="idref" href="#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">&quot;</span></a>'pred' x" := (<a class="idref" href="MoreStlc.html#STLCExtended.tm_pred"><span class="id" title="constructor">tm_pred</span></a> <span class="id" title="var">x</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">x</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id="43eb4b39e17c20cb1da938909e269aa<sub>6</sub>" class="idref" href="#43eb4b39e17c20cb1da938909e269aa<sub>6</sub>"><span class="id" title="notation">&quot;</span></a>x * y" := (<a class="idref" href="MoreStlc.html#STLCExtended.tm_mult"><span class="id" title="constructor">tm_mult</span></a> <span class="id" title="var">x</span> <span class="id" title="var">y</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 1,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">left</span> <span class="id" title="keyword">associativity</span>).<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x" class="idref" href="#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">&quot;</span></a>'if<sub>0</sub>' x 'then' y 'else' z" :=<br/>
&nbsp;&nbsp;(<a class="idref" href="MoreStlc.html#STLCExtended.tm_if<sub>0</sub>"><span class="id" title="constructor">tm_if<sub>0</sub></span></a> <span class="id" title="var">x</span> <span class="id" title="var">y</span> <span class="id" title="var">z</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 89,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">x</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">y</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">z</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">left</span> <span class="id" title="keyword">associativity</span>).<br/>
<span class="id" title="keyword">Coercion</span> <a class="idref" href="MoreStlc.html#STLCExtended.tm_const"><span class="id" title="constructor">tm_const</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.tm_const"><span class="id" title="constructor">:</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.tm_const"><span class="id" title="constructor">nat</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.tm_const"><span class="id" title="constructor">&gt;<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.tm_const"><span class="id" title="constructor">tm</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id="8d02d86020db13ec74895c11a9bd9e<sub>25</sub>" class="idref" href="#8d02d86020db13ec74895c11a9bd9e<sub>25</sub>"><span class="id" title="notation">&quot;</span></a>S + T" :=<br/>
&nbsp;&nbsp;(<a class="idref" href="MoreStlc.html#STLCExtended.Ty_Sum"><span class="id" title="constructor">Ty_Sum</span></a> <span class="id" title="var">S</span> <span class="id" title="var">T</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 3, <span class="id" title="tactic">left</span> <span class="id" title="keyword">associativity</span>).<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc::'inl'_x_x" class="idref" href="#STLCExtended.:stlc::'inl'_x_x"><span class="id" title="notation">&quot;</span></a>'inl' T t" := (<a class="idref" href="MoreStlc.html#STLCExtended.tm_inl"><span class="id" title="constructor">tm_inl</span></a> <span class="id" title="var">T</span> <span class="id" title="var">t</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">T</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">t</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc::'inr'_x_x" class="idref" href="#STLCExtended.:stlc::'inr'_x_x"><span class="id" title="notation">&quot;</span></a>'inr' T t" := (<a class="idref" href="MoreStlc.html#STLCExtended.tm_inr"><span class="id" title="constructor">tm_inr</span></a> <span class="id" title="var">T</span> <span class="id" title="var">t</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">T</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">t</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id="67071c1f1e0255702ad90f4cb618f115" class="idref" href="#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">&quot;</span></a>'case' t<sub>0</sub> 'of' '|' 'inl' x<sub>1</sub> '=&gt;' t<sub>1</sub> '|' 'inr' x<sub>2</sub> '=&gt;' t<sub>2</sub>" :=<br/>
&nbsp;&nbsp;(<a class="idref" href="MoreStlc.html#STLCExtended.tm_case"><span class="id" title="constructor">tm_case</span></a> <span class="id" title="var">t<sub>0</sub></span> <span class="id" title="var">x<sub>1</sub></span> <span class="id" title="var">t<sub>1</sub></span> <span class="id" title="var">x<sub>2</sub></span> <span class="id" title="var">t<sub>2</sub></span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 89,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">t<sub>0</sub></span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">x<sub>1</sub></span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">t<sub>1</sub></span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">x<sub>2</sub></span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">t<sub>2</sub></span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">left</span> <span class="id" title="keyword">associativity</span>).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id="07385bcfe759c5c52b9f596e53f2c0f<sub>5</sub>" class="idref" href="#07385bcfe759c5c52b9f596e53f2c0f<sub>5</sub>"><span class="id" title="notation">&quot;</span></a>X * Y" :=<br/>
&nbsp;&nbsp;(<a class="idref" href="MoreStlc.html#STLCExtended.Ty_Prod"><span class="id" title="constructor">Ty_Prod</span></a> <span class="id" title="var">X</span> <span class="id" title="var">Y</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 2, <span class="id" title="var">X</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span>, <span class="id" title="var">Y</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id="eef70aee8539936ab329e19df9d91f<sub>17</sub>" class="idref" href="#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">&quot;</span></a>( x ',' y )" := (<a class="idref" href="MoreStlc.html#STLCExtended.tm_pair"><span class="id" title="constructor">tm_pair</span></a> <span class="id" title="var">x</span> <span class="id" title="var">y</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">x</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">y</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99).<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc::x_'.fst'" class="idref" href="#STLCExtended.:stlc::x_'.fst'"><span class="id" title="notation">&quot;</span></a>t '.fst'" := (<a class="idref" href="MoreStlc.html#STLCExtended.tm_fst"><span class="id" title="constructor">tm_fst</span></a> <span class="id" title="var">t</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc::x_'.snd'" class="idref" href="#STLCExtended.:stlc::x_'.snd'"><span class="id" title="notation">&quot;</span></a>t '.snd'" := (<a class="idref" href="MoreStlc.html#STLCExtended.tm_snd"><span class="id" title="constructor">tm_snd</span></a> <span class="id" title="var">t</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc_ty::'List'_x" class="idref" href="#STLCExtended.:stlc_ty::'List'_x"><span class="id" title="notation">&quot;</span></a>'List' T" :=<br/>
&nbsp;&nbsp;(<a class="idref" href="MoreStlc.html#STLCExtended.Ty_List"><span class="id" title="constructor">Ty_List</span></a> <span class="id" title="var">T</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 4).<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc::'nil'_x" class="idref" href="#STLCExtended.:stlc::'nil'_x"><span class="id" title="notation">&quot;</span></a>'nil' T" := (<a class="idref" href="MoreStlc.html#STLCExtended.tm_nil"><span class="id" title="constructor">tm_nil</span></a> <span class="id" title="var">T</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0, <span class="id" title="var">T</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc::x_'::'_x" class="idref" href="#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">&quot;</span></a>h '::' t" := (<a class="idref" href="MoreStlc.html#STLCExtended.tm_cons"><span class="id" title="constructor">tm_cons</span></a> <span class="id" title="var">h</span> <span class="id" title="var">t</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 2, <span class="id" title="tactic">right</span> <span class="id" title="keyword">associativity</span>).<br/>
<span class="id" title="keyword">Notation</span> <a id="de876c64e601b25611daf48d0a4b5481" class="idref" href="#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">&quot;</span></a>'case' t<sub>1</sub> 'of' '|' 'nil' '=&gt;' t<sub>2</sub> '|' x '::' y '=&gt;' t<sub>3</sub>" :=<br/>
&nbsp;&nbsp;(<a class="idref" href="MoreStlc.html#STLCExtended.tm_lcase"><span class="id" title="constructor">tm_lcase</span></a> <span class="id" title="var">t<sub>1</sub></span> <span class="id" title="var">t<sub>2</sub></span> <span class="id" title="var">x</span> <span class="id" title="var">y</span> <span class="id" title="var">t<sub>3</sub></span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 89,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">t<sub>1</sub></span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">t<sub>2</sub></span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">x</span> <span class="id" title="keyword">constr</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 1,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">y</span> <span class="id" title="keyword">constr</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 1,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">t<sub>3</sub></span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">left</span> <span class="id" title="keyword">associativity</span>).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc_ty::'Unit'" class="idref" href="#STLCExtended.:stlc_ty::'Unit'"><span class="id" title="notation">&quot;</span></a>'Unit'" :=<br/>
&nbsp;&nbsp;(<a class="idref" href="MoreStlc.html#STLCExtended.Ty_Unit"><span class="id" title="constructor">Ty_Unit</span></a>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc::'unit'" class="idref" href="#STLCExtended.:stlc::'unit'"><span class="id" title="notation">&quot;</span></a>'unit'" := <a class="idref" href="MoreStlc.html#STLCExtended.tm_unit"><span class="id" title="constructor">tm_unit</span></a> (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id="70f8b4f45f8b8110132e9be18ff33560" class="idref" href="#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">&quot;</span></a>'let' x '=' t<sub>1</sub> 'in' t<sub>2</sub>" :=<br/>
&nbsp;&nbsp;(<a class="idref" href="MoreStlc.html#STLCExtended.tm_let"><span class="id" title="constructor">tm_let</span></a> <span class="id" title="var">x</span> <span class="id" title="var">t<sub>1</sub></span> <span class="id" title="var">t<sub>2</sub></span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.:stlc::'fix'_x" class="idref" href="#STLCExtended.:stlc::'fix'_x"><span class="id" title="notation">&quot;</span></a>'fix' t" := (<a class="idref" href="MoreStlc.html#STLCExtended.tm_fix"><span class="id" title="constructor">tm_fix</span></a> <span class="id" title="var">t</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
</div>

<div class="doc">
<a id="lab279"></a><h3 class="section">Substitution</h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Reserved Notation</span> &quot;'[' x ':=' s ']' t" (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 20, <span class="id" title="var">x</span> <span class="id" title="keyword">constr</span>).<br/>
<span class="id" title="keyword">Fixpoint</span> <a id="STLCExtended.subst" class="idref" href="#STLCExtended.subst"><span class="id" title="definition">subst</span></a> (<a id="x:5" class="idref" href="#x:5"><span class="id" title="binder">x</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a>) (<a id="s:6" class="idref" href="#s:6"><span class="id" title="binder">s</span></a> : <a class="idref" href="MoreStlc.html#STLCExtended.tm"><span class="id" title="inductive">tm</span></a>) (<a id="t:7" class="idref" href="#t:7"><span class="id" title="binder">t</span></a> : <a class="idref" href="MoreStlc.html#STLCExtended.tm"><span class="id" title="inductive">tm</span></a>) : <a class="idref" href="MoreStlc.html#STLCExtended.tm"><span class="id" title="inductive">tm</span></a> :=<br/>
&nbsp;&nbsp;<span class="id" title="keyword">match</span> <a class="idref" href="MoreStlc.html#t:7"><span class="id" title="variable">t</span></a> <span class="id" title="keyword">with</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;pure&nbsp;STLC&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a class="idref" href="MoreStlc.html#STLCExtended.tm_var"><span class="id" title="constructor">tm_var</span></a> <span class="id" title="var">y</span> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">if</span> <span class="id" title="definition">eqb_string</span> <a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a> <span class="id" title="var">y</span> <span class="id" title="keyword">then</span> <a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a> <span class="id" title="keyword">else</span> <a class="idref" href="MoreStlc.html#t:7"><span class="id" title="variable">t</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><span class="id" title="var">y</span><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><span class="id" title="var">T</span><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a> <span class="id" title="var">t<sub>1</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">if</span> <span class="id" title="definition">eqb_string</span> <a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a> <span class="id" title="var">y</span> <span class="id" title="keyword">then</span> <a class="idref" href="MoreStlc.html#t:7"><span class="id" title="variable">t</span></a> <span class="id" title="keyword">else</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><span class="id" title="var">y</span><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><span class="id" title="var">T</span><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>1</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><span class="id" title="var">t<sub>1</sub></span> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>1</sub></span><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;numbers&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a class="idref" href="MoreStlc.html#STLCExtended.tm_const"><span class="id" title="constructor">tm_const</span></a> <span class="id" title="var">_</span> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t:7"><span class="id" title="variable">t</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'succ'_x"><span class="id" title="notation">succ</span></a> <span class="id" title="var">t<sub>1</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'succ'_x"><span class="id" title="notation">succ</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a> <a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>1</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">pred</span></a> <span class="id" title="var">t<sub>1</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">pred</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a> <a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>1</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="MoreStlc.html#43eb4b39e17c20cb1da938909e269aa<sub>6</sub>"><span class="id" title="notation">×</span></a> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a> <a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>1</sub></span><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#43eb4b39e17c20cb1da938909e269aa<sub>6</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a> <a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a> <span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <span class="id" title="var">t<sub>2</sub></span> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <span class="id" title="var">t<sub>3</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a> <a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a> <a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>2</sub></span> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a> <a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>3</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;sums&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inl'_x_x"><span class="id" title="notation">inl</span></a> <span class="id" title="var">T<sub>2</sub></span> <span class="id" title="var">t<sub>1</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inl'_x_x"><span class="id" title="notation">inl</span></a> <span class="id" title="var">T<sub>2</sub></span> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>1</sub></span><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inr'_x_x"><span class="id" title="notation">inr</span></a> <span class="id" title="var">T<sub>1</sub></span> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inr'_x_x"><span class="id" title="notation">inr</span></a> <span class="id" title="var">T<sub>1</sub></span> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">case</span></a> <span class="id" title="var">t<sub>0</sub></span> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">of</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inl</span></a> <span class="id" title="var">y<sub>1</sub></span> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inr</span></a> <span class="id" title="var">y<sub>2</sub></span> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>0</sub></span><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">of</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inl</span></a> <span class="id" title="var">y<sub>1</sub></span> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">{</span></a> <span class="id" title="keyword">if</span> <span class="id" title="definition">eqb_string</span> <a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a> <span class="id" title="var">y<sub>1</sub></span> <span class="id" title="keyword">then</span> <span class="id" title="var">t<sub>1</sub></span> <span class="id" title="keyword">else</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">}</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inr</span></a> <span class="id" title="var">y<sub>2</sub></span> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">{</span></a><span class="id" title="keyword">if</span> <span class="id" title="definition">eqb_string</span> <a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a> <span class="id" title="var">y<sub>2</sub></span> <span class="id" title="keyword">then</span> <span class="id" title="var">t<sub>2</sub></span> <span class="id" title="keyword">else</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>2</sub></span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">}</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;lists&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'nil'_x"><span class="id" title="notation">nil</span></a> <span class="id" title="var">_</span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t:7"><span class="id" title="variable">t</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>1</sub></span><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>2</sub></span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">case</span></a> <span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">of</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <span class="id" title="var">t<sub>2</sub></span> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <span class="id" title="var">y<sub>1</sub></span> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">::</span></a> <span class="id" title="var">y<sub>2</sub></span> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <span class="id" title="var">t<sub>3</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">of</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>2</sub></span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <span class="id" title="var">y<sub>1</sub></span> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">::</span></a> <span class="id" title="var">y<sub>2</sub></span> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">{</span></a><span class="id" title="keyword">if</span> <span class="id" title="definition">eqb_string</span> <a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a> <span class="id" title="var">y<sub>1</sub></span> <span class="id" title="keyword">then</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">t<sub>3</sub></span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">else</span> <span class="id" title="keyword">if</span> <span class="id" title="definition">eqb_string</span> <a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a> <span class="id" title="var">y<sub>2</sub></span> <span class="id" title="keyword">then</span> <span class="id" title="var">t<sub>3</sub></span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">else</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>3</sub></span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">}</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;unit&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'unit'"><span class="id" title="notation">unit</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> ⇒ <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'unit'"><span class="id" title="notation">unit</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;Complete&nbsp;the&nbsp;following&nbsp;cases.&nbsp;*)</span><br/>
<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;pairs&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;let&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;fix&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
&nbsp;&nbsp;| <span class="id" title="var">_</span> ⇒ <a class="idref" href="MoreStlc.html#t:7"><span class="id" title="variable">t</span></a>  <span class="comment">(*&nbsp;...&nbsp;and&nbsp;delete&nbsp;this&nbsp;line&nbsp;when&nbsp;you&nbsp;finish&nbsp;the&nbsp;exercise&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="id" title="keyword">end</span><br/>
<br/>
<span class="id" title="keyword">where</span> <a id="d35e897ce075945f087982f143864505" class="idref" href="#d35e897ce075945f087982f143864505"><span class="id" title="notation">&quot;</span></a>'[' x ':=' s ']' t" := (<a class="idref" href="MoreStlc.html#subst:8"><span class="id" title="definition">subst</span></a> <span class="id" title="var">x</span> <span class="id" title="var">s</span> <span class="id" title="var">t</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span>).<br/>
</div>

<div class="doc">
<a id="lab280"></a><h3 class="section">Reduction</h3>

<div class="paragraph"> </div>

 Next we define the values of our language. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Inductive</span> <a id="STLCExtended.value" class="idref" href="#STLCExtended.value"><span class="id" title="inductive">value</span></a> : <a class="idref" href="MoreStlc.html#STLCExtended.tm"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <span class="id" title="keyword">Prop</span> :=<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;In&nbsp;pure&nbsp;STLC,&nbsp;function&nbsp;abstractions&nbsp;are&nbsp;values:&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.v_abs" class="idref" href="#STLCExtended.v_abs"><span class="id" title="constructor">v_abs</span></a> : <span class="id" title="keyword">∀</span> <a id="x:12" class="idref" href="#x:12"><span class="id" title="binder">x</span></a> <a id="T<sub>2</sub>:13" class="idref" href="#T<sub>2</sub>:13"><span class="id" title="binder">T<sub>2</sub></span></a> <a id="t<sub>1</sub>:14" class="idref" href="#t<sub>1</sub>:14"><span class="id" title="binder">t<sub>1</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#x:12"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><a class="idref" href="MoreStlc.html#T<sub>2</sub>:13"><span class="id" title="variable">T<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:14"><span class="id" title="variable">t<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;Numbers&nbsp;are&nbsp;values:&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.v_nat" class="idref" href="#STLCExtended.v_nat"><span class="id" title="constructor">v_nat</span></a> : <span class="id" title="keyword">∀</span> <a id="n:15" class="idref" href="#n:15"><span class="id" title="binder">n</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nat"><span class="id" title="inductive">nat</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#n:15"><span class="id" title="variable">n</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;A&nbsp;tagged&nbsp;value&nbsp;is&nbsp;a&nbsp;value:&nbsp;&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.v_inl" class="idref" href="#STLCExtended.v_inl"><span class="id" title="constructor">v_inl</span></a> : <span class="id" title="keyword">∀</span> <a id="v:16" class="idref" href="#v:16"><span class="id" title="binder">v</span></a> <a id="T<sub>1</sub>:17" class="idref" href="#T<sub>1</sub>:17"><span class="id" title="binder">T<sub>1</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#v:16"><span class="id" title="variable">v</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inl'_x_x"><span class="id" title="notation">inl</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:17"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#v:16"><span class="id" title="variable">v</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.v_inr" class="idref" href="#STLCExtended.v_inr"><span class="id" title="constructor">v_inr</span></a> : <span class="id" title="keyword">∀</span> <a id="v:18" class="idref" href="#v:18"><span class="id" title="binder">v</span></a> <a id="T<sub>1</sub>:19" class="idref" href="#T<sub>1</sub>:19"><span class="id" title="binder">T<sub>1</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#v:18"><span class="id" title="variable">v</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inr'_x_x"><span class="id" title="notation">inr</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:19"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#v:18"><span class="id" title="variable">v</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;A&nbsp;list&nbsp;is&nbsp;a&nbsp;value&nbsp;iff&nbsp;its&nbsp;head&nbsp;and&nbsp;tail&nbsp;are&nbsp;values:&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.v_lnil" class="idref" href="#STLCExtended.v_lnil"><span class="id" title="constructor">v_lnil</span></a> : <span class="id" title="keyword">∀</span> <a id="T<sub>1</sub>:20" class="idref" href="#T<sub>1</sub>:20"><span class="id" title="binder">T<sub>1</sub></span></a>, <a class="idref" href="MoreStlc.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'nil'_x"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:20"><span class="id" title="variable">T<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.v_lcons" class="idref" href="#STLCExtended.v_lcons"><span class="id" title="constructor">v_lcons</span></a> : <span class="id" title="keyword">∀</span> <a id="v<sub>1</sub>:21" class="idref" href="#v<sub>1</sub>:21"><span class="id" title="binder">v<sub>1</sub></span></a> <a id="v<sub>2</sub>:22" class="idref" href="#v<sub>2</sub>:22"><span class="id" title="binder">v<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#v<sub>1</sub>:21"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#v<sub>2</sub>:22"><span class="id" title="variable">v<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#v<sub>1</sub>:21"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#v<sub>2</sub>:22"><span class="id" title="variable">v<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;A&nbsp;unit&nbsp;is&nbsp;always&nbsp;a&nbsp;value&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.v_unit" class="idref" href="#STLCExtended.v_unit"><span class="id" title="constructor">v_unit</span></a> : <a class="idref" href="MoreStlc.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'unit'"><span class="id" title="notation">unit</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;A&nbsp;pair&nbsp;is&nbsp;a&nbsp;value&nbsp;if&nbsp;both&nbsp;components&nbsp;are:&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.v_pair" class="idref" href="#STLCExtended.v_pair"><span class="id" title="constructor">v_pair</span></a> : <span class="id" title="keyword">∀</span> <a id="v<sub>1</sub>:23" class="idref" href="#v<sub>1</sub>:23"><span class="id" title="binder">v<sub>1</sub></span></a> <a id="v<sub>2</sub>:24" class="idref" href="#v<sub>2</sub>:24"><span class="id" title="binder">v<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#v<sub>1</sub>:23"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#v<sub>2</sub>:24"><span class="id" title="variable">v<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#v<sub>1</sub>:23"><span class="id" title="variable">v<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">,</span></a> <a class="idref" href="MoreStlc.html#v<sub>2</sub>:24"><span class="id" title="variable">v<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Hint Constructors</span> <a class="idref" href="MoreStlc.html#value"><span class="id" title="inductive">value</span></a> : <span class="id" title="var">core</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Reserved Notation</span> &quot;t '<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>' t'" (<span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 40).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Inductive</span> <a id="STLCExtended.step" class="idref" href="#STLCExtended.step"><span class="id" title="inductive">step</span></a> : <a class="idref" href="MoreStlc.html#STLCExtended.tm"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.tm"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <span class="id" title="keyword">Prop</span> :=<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;pure&nbsp;STLC&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_AppAbs" class="idref" href="#STLCExtended.ST_AppAbs"><span class="id" title="constructor">ST_AppAbs</span></a> : <span class="id" title="keyword">∀</span> <a id="x:27" class="idref" href="#x:27"><span class="id" title="binder">x</span></a> <a id="T<sub>2</sub>:28" class="idref" href="#T<sub>2</sub>:28"><span class="id" title="binder">T<sub>2</sub></span></a> <a id="t<sub>1</sub>:29" class="idref" href="#t<sub>1</sub>:29"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="v<sub>2</sub>:30" class="idref" href="#v<sub>2</sub>:30"><span class="id" title="binder">v<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.value"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#v<sub>2</sub>:30"><span class="id" title="variable">v<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#x:27"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><a class="idref" href="MoreStlc.html#T<sub>2</sub>:28"><span class="id" title="variable">T<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:29"><span class="id" title="variable">t<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#v<sub>2</sub>:30"><span class="id" title="variable">v<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:27"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#v<sub>2</sub>:30"><span class="id" title="variable">v<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a><a class="idref" href="MoreStlc.html#t<sub>1</sub>:29"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_App1" class="idref" href="#STLCExtended.ST_App1"><span class="id" title="constructor">ST_App1</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>1</sub>:31" class="idref" href="#t<sub>1</sub>:31"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>1</sub>':32" class="idref" href="#t<sub>1</sub>':32"><span class="id" title="binder">t<sub>1</sub>'</span></a> <a id="t<sub>2</sub>:33" class="idref" href="#t<sub>2</sub>:33"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t<sub>1</sub>:31"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>':32"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#t<sub>1</sub>:31"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:33"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#t<sub>1</sub>':32"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:33"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_App2" class="idref" href="#STLCExtended.ST_App2"><span class="id" title="constructor">ST_App2</span></a> : <span class="id" title="keyword">∀</span> <a id="v<sub>1</sub>:34" class="idref" href="#v<sub>1</sub>:34"><span class="id" title="binder">v<sub>1</sub></span></a> <a id="t<sub>2</sub>:35" class="idref" href="#t<sub>2</sub>:35"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="t<sub>2</sub>':36" class="idref" href="#t<sub>2</sub>':36"><span class="id" title="binder">t<sub>2</sub>'</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.value"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#v<sub>1</sub>:34"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t<sub>2</sub>:35"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>':36"><span class="id" title="variable">t<sub>2</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#v<sub>1</sub>:34"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:35"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#v<sub>1</sub>:34"><span class="id" title="variable">v<sub>1</sub></span></a>  <a class="idref" href="MoreStlc.html#t<sub>2</sub>':36"><span class="id" title="variable">t<sub>2</sub>'</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;numbers&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_Succ" class="idref" href="#STLCExtended.ST_Succ"><span class="id" title="constructor">ST_Succ</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>1</sub>:37" class="idref" href="#t<sub>1</sub>:37"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>1</sub>':38" class="idref" href="#t<sub>1</sub>':38"><span class="id" title="binder">t<sub>1</sub>'</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t<sub>1</sub>:37"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>':38"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'succ'_x"><span class="id" title="notation">succ</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:37"><span class="id" title="variable">t<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'succ'_x"><span class="id" title="notation">succ</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>':38"><span class="id" title="variable">t<sub>1</sub>'</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_SuccNat" class="idref" href="#STLCExtended.ST_SuccNat"><span class="id" title="constructor">ST_SuccNat</span></a> : <span class="id" title="keyword">∀</span> <a id="n:39" class="idref" href="#n:39"><span class="id" title="binder">n</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nat"><span class="id" title="inductive">nat</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'succ'_x"><span class="id" title="notation">succ</span></a> <a class="idref" href="MoreStlc.html#n:39"><span class="id" title="variable">n</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">{</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#S"><span class="id" title="constructor">S</span></a> <a class="idref" href="MoreStlc.html#n:39"><span class="id" title="variable">n</span></a><a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">}</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_Pred" class="idref" href="#STLCExtended.ST_Pred"><span class="id" title="constructor">ST_Pred</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>1</sub>:40" class="idref" href="#t<sub>1</sub>:40"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>1</sub>':41" class="idref" href="#t<sub>1</sub>':41"><span class="id" title="binder">t<sub>1</sub>'</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t<sub>1</sub>:40"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>':41"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">pred</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:40"><span class="id" title="variable">t<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">pred</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>':41"><span class="id" title="variable">t<sub>1</sub>'</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_PredNat" class="idref" href="#STLCExtended.ST_PredNat"><span class="id" title="constructor">ST_PredNat</span></a> : <span class="id" title="keyword">∀</span> <a id="n:42" class="idref" href="#n:42"><span class="id" title="binder">n</span></a>:<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nat"><span class="id" title="inductive">nat</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">pred</span></a> <a class="idref" href="MoreStlc.html#n:42"><span class="id" title="variable">n</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">{</span></a><a class="idref" href="MoreStlc.html#n:42"><span class="id" title="variable">n</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Peano.html#::nat_scope:x_'-'_x"><span class="id" title="notation">-</span></a> 1<a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">}</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_Mulconsts" class="idref" href="#STLCExtended.ST_Mulconsts"><span class="id" title="constructor">ST_Mulconsts</span></a> : <span class="id" title="keyword">∀</span> <a id="n<sub>1</sub>:43" class="idref" href="#n<sub>1</sub>:43"><span class="id" title="binder">n<sub>1</sub></span></a> <a id="n<sub>2</sub>:44" class="idref" href="#n<sub>2</sub>:44"><span class="id" title="binder">n<sub>2</sub></span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nat"><span class="id" title="inductive">nat</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#n<sub>1</sub>:43"><span class="id" title="variable">n<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#43eb4b39e17c20cb1da938909e269aa<sub>6</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="MoreStlc.html#n<sub>2</sub>:44"><span class="id" title="variable">n<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">{</span></a><a class="idref" href="MoreStlc.html#n<sub>1</sub>:43"><span class="id" title="variable">n<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Peano.html#ea2ff3d561159081cea6fb2e8113cc<sub>54</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="MoreStlc.html#n<sub>2</sub>:44"><span class="id" title="variable">n<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">}</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_Mult1" class="idref" href="#STLCExtended.ST_Mult1"><span class="id" title="constructor">ST_Mult1</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>1</sub>:45" class="idref" href="#t<sub>1</sub>:45"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>1</sub>':46" class="idref" href="#t<sub>1</sub>':46"><span class="id" title="binder">t<sub>1</sub>'</span></a> <a id="t<sub>2</sub>:47" class="idref" href="#t<sub>2</sub>:47"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t<sub>1</sub>:45"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>':46"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#t<sub>1</sub>:45"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#43eb4b39e17c20cb1da938909e269aa<sub>6</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:47"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#t<sub>1</sub>':46"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="MoreStlc.html#43eb4b39e17c20cb1da938909e269aa<sub>6</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:47"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_Mult2" class="idref" href="#STLCExtended.ST_Mult2"><span class="id" title="constructor">ST_Mult2</span></a> : <span class="id" title="keyword">∀</span> <a id="v<sub>1</sub>:48" class="idref" href="#v<sub>1</sub>:48"><span class="id" title="binder">v<sub>1</sub></span></a> <a id="t<sub>2</sub>:49" class="idref" href="#t<sub>2</sub>:49"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="t<sub>2</sub>':50" class="idref" href="#t<sub>2</sub>':50"><span class="id" title="binder">t<sub>2</sub>'</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.value"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#v<sub>1</sub>:48"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t<sub>2</sub>:49"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>':50"><span class="id" title="variable">t<sub>2</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#v<sub>1</sub>:48"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#43eb4b39e17c20cb1da938909e269aa<sub>6</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:49"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#v<sub>1</sub>:48"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#43eb4b39e17c20cb1da938909e269aa<sub>6</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>':50"><span class="id" title="variable">t<sub>2</sub>'</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_If<sub>0</sub>" class="idref" href="#STLCExtended.ST_If<sub>0</sub>"><span class="id" title="constructor">ST_If<sub>0</sub></span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>1</sub>:51" class="idref" href="#t<sub>1</sub>:51"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>1</sub>':52" class="idref" href="#t<sub>1</sub>':52"><span class="id" title="binder">t<sub>1</sub>'</span></a> <a id="t<sub>2</sub>:53" class="idref" href="#t<sub>2</sub>:53"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="t<sub>3</sub>:54" class="idref" href="#t<sub>3</sub>:54"><span class="id" title="binder">t<sub>3</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t<sub>1</sub>:51"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>':52"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:51"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:53"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="MoreStlc.html#t<sub>3</sub>:54"><span class="id" title="variable">t<sub>3</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>':52"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:53"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="MoreStlc.html#t<sub>3</sub>:54"><span class="id" title="variable">t<sub>3</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_If0_Zero" class="idref" href="#STLCExtended.ST_If0_Zero"><span class="id" title="constructor">ST_If0_Zero</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>2</sub>:55" class="idref" href="#t<sub>2</sub>:55"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="t<sub>3</sub>:56" class="idref" href="#t<sub>3</sub>:56"><span class="id" title="binder">t<sub>3</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a> 0 <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:55"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="MoreStlc.html#t<sub>3</sub>:56"><span class="id" title="variable">t<sub>3</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:55"><span class="id" title="variable">t<sub>2</sub></span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_If0_Nonzero" class="idref" href="#STLCExtended.ST_If0_Nonzero"><span class="id" title="constructor">ST_If0_Nonzero</span></a> : <span class="id" title="keyword">∀</span> <a id="n:57" class="idref" href="#n:57"><span class="id" title="binder">n</span></a> <a id="t<sub>2</sub>:58" class="idref" href="#t<sub>2</sub>:58"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="t<sub>3</sub>:59" class="idref" href="#t<sub>3</sub>:59"><span class="id" title="binder">t<sub>3</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">{</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#S"><span class="id" title="constructor">S</span></a> <a class="idref" href="MoreStlc.html#n:57"><span class="id" title="variable">n</span></a><a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">}</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:58"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="MoreStlc.html#t<sub>3</sub>:59"><span class="id" title="variable">t<sub>3</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>3</sub>:59"><span class="id" title="variable">t<sub>3</sub></span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;sums&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_Inl" class="idref" href="#STLCExtended.ST_Inl"><span class="id" title="constructor">ST_Inl</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>1</sub>:60" class="idref" href="#t<sub>1</sub>:60"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>1</sub>':61" class="idref" href="#t<sub>1</sub>':61"><span class="id" title="binder">t<sub>1</sub>'</span></a> <a id="T<sub>2</sub>:62" class="idref" href="#T<sub>2</sub>:62"><span class="id" title="binder">T<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t<sub>1</sub>:60"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>':61"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inl'_x_x"><span class="id" title="notation">inl</span></a> <a class="idref" href="MoreStlc.html#T<sub>2</sub>:62"><span class="id" title="variable">T<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:60"><span class="id" title="variable">t<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inl'_x_x"><span class="id" title="notation">inl</span></a> <a class="idref" href="MoreStlc.html#T<sub>2</sub>:62"><span class="id" title="variable">T<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>':61"><span class="id" title="variable">t<sub>1</sub>'</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_Inr" class="idref" href="#STLCExtended.ST_Inr"><span class="id" title="constructor">ST_Inr</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>2</sub>:63" class="idref" href="#t<sub>2</sub>:63"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="t<sub>2</sub>':64" class="idref" href="#t<sub>2</sub>':64"><span class="id" title="binder">t<sub>2</sub>'</span></a> <a id="T<sub>1</sub>:65" class="idref" href="#T<sub>1</sub>:65"><span class="id" title="binder">T<sub>1</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t<sub>2</sub>:63"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>':64"><span class="id" title="variable">t<sub>2</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inr'_x_x"><span class="id" title="notation">inr</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:65"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:63"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inr'_x_x"><span class="id" title="notation">inr</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:65"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>':64"><span class="id" title="variable">t<sub>2</sub>'</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_Case" class="idref" href="#STLCExtended.ST_Case"><span class="id" title="constructor">ST_Case</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>0</sub>:66" class="idref" href="#t<sub>0</sub>:66"><span class="id" title="binder">t<sub>0</sub></span></a> <a id="t<sub>0</sub>':67" class="idref" href="#t<sub>0</sub>':67"><span class="id" title="binder">t<sub>0</sub>'</span></a> <a id="x<sub>1</sub>:68" class="idref" href="#x<sub>1</sub>:68"><span class="id" title="binder">x<sub>1</sub></span></a> <a id="t<sub>1</sub>:69" class="idref" href="#t<sub>1</sub>:69"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="x<sub>2</sub>:70" class="idref" href="#x<sub>2</sub>:70"><span class="id" title="binder">x<sub>2</sub></span></a> <a id="t<sub>2</sub>:71" class="idref" href="#t<sub>2</sub>:71"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t<sub>0</sub>:66"><span class="id" title="variable">t<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>0</sub>':67"><span class="id" title="variable">t<sub>0</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#t<sub>0</sub>:66"><span class="id" title="variable">t<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">of</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inl</span></a> <a class="idref" href="MoreStlc.html#x<sub>1</sub>:68"><span class="id" title="variable">x<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:69"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inr</span></a> <a class="idref" href="MoreStlc.html#x<sub>2</sub>:70"><span class="id" title="variable">x<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:71"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#t<sub>0</sub>':67"><span class="id" title="variable">t<sub>0</sub>'</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">of</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inl</span></a> <a class="idref" href="MoreStlc.html#x<sub>1</sub>:68"><span class="id" title="variable">x<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:69"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inr</span></a> <a class="idref" href="MoreStlc.html#x<sub>2</sub>:70"><span class="id" title="variable">x<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:71"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_CaseInl" class="idref" href="#STLCExtended.ST_CaseInl"><span class="id" title="constructor">ST_CaseInl</span></a> : <span class="id" title="keyword">∀</span> <a id="v<sub>0</sub>:72" class="idref" href="#v<sub>0</sub>:72"><span class="id" title="binder">v<sub>0</sub></span></a> <a id="x<sub>1</sub>:73" class="idref" href="#x<sub>1</sub>:73"><span class="id" title="binder">x<sub>1</sub></span></a> <a id="t<sub>1</sub>:74" class="idref" href="#t<sub>1</sub>:74"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="x<sub>2</sub>:75" class="idref" href="#x<sub>2</sub>:75"><span class="id" title="binder">x<sub>2</sub></span></a> <a id="t<sub>2</sub>:76" class="idref" href="#t<sub>2</sub>:76"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="T<sub>2</sub>:77" class="idref" href="#T<sub>2</sub>:77"><span class="id" title="binder">T<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.value"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#v<sub>0</sub>:72"><span class="id" title="variable">v<sub>0</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inl'_x_x"><span class="id" title="notation">inl</span></a> <a class="idref" href="MoreStlc.html#T<sub>2</sub>:77"><span class="id" title="variable">T<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#v<sub>0</sub>:72"><span class="id" title="variable">v<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">of</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inl</span></a> <a class="idref" href="MoreStlc.html#x<sub>1</sub>:73"><span class="id" title="variable">x<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:74"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inr</span></a> <a class="idref" href="MoreStlc.html#x<sub>2</sub>:75"><span class="id" title="variable">x<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:76"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x<sub>1</sub>:73"><span class="id" title="variable">x<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#v<sub>0</sub>:72"><span class="id" title="variable">v<sub>0</sub></span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a><a class="idref" href="MoreStlc.html#t<sub>1</sub>:74"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_CaseInr" class="idref" href="#STLCExtended.ST_CaseInr"><span class="id" title="constructor">ST_CaseInr</span></a> : <span class="id" title="keyword">∀</span> <a id="v<sub>0</sub>:78" class="idref" href="#v<sub>0</sub>:78"><span class="id" title="binder">v<sub>0</sub></span></a> <a id="x<sub>1</sub>:79" class="idref" href="#x<sub>1</sub>:79"><span class="id" title="binder">x<sub>1</sub></span></a> <a id="t<sub>1</sub>:80" class="idref" href="#t<sub>1</sub>:80"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="x<sub>2</sub>:81" class="idref" href="#x<sub>2</sub>:81"><span class="id" title="binder">x<sub>2</sub></span></a> <a id="t<sub>2</sub>:82" class="idref" href="#t<sub>2</sub>:82"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="T<sub>1</sub>:83" class="idref" href="#T<sub>1</sub>:83"><span class="id" title="binder">T<sub>1</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.value"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#v<sub>0</sub>:78"><span class="id" title="variable">v<sub>0</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inr'_x_x"><span class="id" title="notation">inr</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:83"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#v<sub>0</sub>:78"><span class="id" title="variable">v<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">of</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inl</span></a> <a class="idref" href="MoreStlc.html#x<sub>1</sub>:79"><span class="id" title="variable">x<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:80"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inr</span></a> <a class="idref" href="MoreStlc.html#x<sub>2</sub>:81"><span class="id" title="variable">x<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:82"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x<sub>2</sub>:81"><span class="id" title="variable">x<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#v<sub>0</sub>:78"><span class="id" title="variable">v<sub>0</sub></span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a><a class="idref" href="MoreStlc.html#t<sub>2</sub>:82"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;lists&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_Cons1" class="idref" href="#STLCExtended.ST_Cons1"><span class="id" title="constructor">ST_Cons1</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>1</sub>:84" class="idref" href="#t<sub>1</sub>:84"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>1</sub>':85" class="idref" href="#t<sub>1</sub>':85"><span class="id" title="binder">t<sub>1</sub>'</span></a> <a id="t<sub>2</sub>:86" class="idref" href="#t<sub>2</sub>:86"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t<sub>1</sub>:84"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>':85"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#t<sub>1</sub>:84"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:86"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#t<sub>1</sub>':85"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:86"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_Cons2" class="idref" href="#STLCExtended.ST_Cons2"><span class="id" title="constructor">ST_Cons2</span></a> : <span class="id" title="keyword">∀</span> <a id="v<sub>1</sub>:87" class="idref" href="#v<sub>1</sub>:87"><span class="id" title="binder">v<sub>1</sub></span></a> <a id="t<sub>2</sub>:88" class="idref" href="#t<sub>2</sub>:88"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="t<sub>2</sub>':89" class="idref" href="#t<sub>2</sub>':89"><span class="id" title="binder">t<sub>2</sub>'</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.value"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#v<sub>1</sub>:87"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t<sub>2</sub>:88"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>':89"><span class="id" title="variable">t<sub>2</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#v<sub>1</sub>:87"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:88"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#v<sub>1</sub>:87"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>':89"><span class="id" title="variable">t<sub>2</sub>'</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_Lcase1" class="idref" href="#STLCExtended.ST_Lcase1"><span class="id" title="constructor">ST_Lcase1</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>1</sub>:90" class="idref" href="#t<sub>1</sub>:90"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>1</sub>':91" class="idref" href="#t<sub>1</sub>':91"><span class="id" title="binder">t<sub>1</sub>'</span></a> <a id="t<sub>2</sub>:92" class="idref" href="#t<sub>2</sub>:92"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="x<sub>1</sub>:93" class="idref" href="#x<sub>1</sub>:93"><span class="id" title="binder">x<sub>1</sub></span></a> <a id="x<sub>2</sub>:94" class="idref" href="#x<sub>2</sub>:94"><span class="id" title="binder">x<sub>2</sub></span></a> <a id="t<sub>3</sub>:95" class="idref" href="#t<sub>3</sub>:95"><span class="id" title="binder">t<sub>3</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t<sub>1</sub>:90"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>':91"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:90"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">of</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:92"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#x<sub>1</sub>:93"><span class="id" title="variable">x<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#x<sub>2</sub>:94"><span class="id" title="variable">x<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>3</sub>:95"><span class="id" title="variable">t<sub>3</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>':91"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">of</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:92"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#x<sub>1</sub>:93"><span class="id" title="variable">x<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#x<sub>2</sub>:94"><span class="id" title="variable">x<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>3</sub>:95"><span class="id" title="variable">t<sub>3</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_LcaseNil" class="idref" href="#STLCExtended.ST_LcaseNil"><span class="id" title="constructor">ST_LcaseNil</span></a> : <span class="id" title="keyword">∀</span> <a id="T<sub>1</sub>:96" class="idref" href="#T<sub>1</sub>:96"><span class="id" title="binder">T<sub>1</sub></span></a> <a id="t<sub>2</sub>:97" class="idref" href="#t<sub>2</sub>:97"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="x<sub>1</sub>:98" class="idref" href="#x<sub>1</sub>:98"><span class="id" title="binder">x<sub>1</sub></span></a> <a id="x<sub>2</sub>:99" class="idref" href="#x<sub>2</sub>:99"><span class="id" title="binder">x<sub>2</sub></span></a> <a id="t<sub>3</sub>:100" class="idref" href="#t<sub>3</sub>:100"><span class="id" title="binder">t<sub>3</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'nil'_x"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:96"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">of</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:97"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#x<sub>1</sub>:98"><span class="id" title="variable">x<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#x<sub>2</sub>:99"><span class="id" title="variable">x<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>3</sub>:100"><span class="id" title="variable">t<sub>3</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:97"><span class="id" title="variable">t<sub>2</sub></span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.ST_LcaseCons" class="idref" href="#STLCExtended.ST_LcaseCons"><span class="id" title="constructor">ST_LcaseCons</span></a> : <span class="id" title="keyword">∀</span> <a id="v<sub>1</sub>:101" class="idref" href="#v<sub>1</sub>:101"><span class="id" title="binder">v<sub>1</sub></span></a> <a id="vl:102" class="idref" href="#vl:102"><span class="id" title="binder">vl</span></a> <a id="t<sub>2</sub>:103" class="idref" href="#t<sub>2</sub>:103"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="x<sub>1</sub>:104" class="idref" href="#x<sub>1</sub>:104"><span class="id" title="binder">x<sub>1</sub></span></a> <a id="x<sub>2</sub>:105" class="idref" href="#x<sub>2</sub>:105"><span class="id" title="binder">x<sub>2</sub></span></a> <a id="t<sub>3</sub>:106" class="idref" href="#t<sub>3</sub>:106"><span class="id" title="binder">t<sub>3</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.value"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#v<sub>1</sub>:101"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.value"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#vl:102"><span class="id" title="variable">vl</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#v<sub>1</sub>:101"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#vl:102"><span class="id" title="variable">vl</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">of</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:103"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#x<sub>1</sub>:104"><span class="id" title="variable">x<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#x<sub>2</sub>:105"><span class="id" title="variable">x<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>3</sub>:106"><span class="id" title="variable">t<sub>3</sub></span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a>  <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x<sub>2</sub>:105"><span class="id" title="variable">x<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a> <a class="idref" href="MoreStlc.html#vl:102"><span class="id" title="variable">vl</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x<sub>1</sub>:104"><span class="id" title="variable">x<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a> <a class="idref" href="MoreStlc.html#v<sub>1</sub>:101"><span class="id" title="variable">v<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a> <a class="idref" href="MoreStlc.html#t<sub>3</sub>:106"><span class="id" title="variable">t<sub>3</sub></span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;Add&nbsp;rules&nbsp;for&nbsp;the&nbsp;following&nbsp;extensions.&nbsp;*)</span><br/>
<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;pairs&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;let&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;fix&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
<br/>
&nbsp;&nbsp;<span class="id" title="keyword">where</span> <a id="STLCExtended.:::x_'--&gt;'_x" class="idref" href="#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation">&quot;</span></a>t '<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>' t'" := (<a class="idref" href="MoreStlc.html#step:26"><span class="id" title="inductive">step</span></a> <span class="id" title="var">t</span> <span class="id" title="var">t'</span>).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.multistep" class="idref" href="#STLCExtended.multistep"><span class="id" title="abbreviation">multistep</span></a> := (<a class="idref" href="Smallstep.html#multi"><span class="id" title="inductive">multi</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.step"><span class="id" title="inductive">step</span></a>).<br/>
<span class="id" title="keyword">Notation</span> <a id="9cd10f7cb4dfdde0d448b6577b0f7bdd" class="idref" href="#9cd10f7cb4dfdde0d448b6577b0f7bdd"><span class="id" title="notation">&quot;</span></a>t<sub>1</sub> '<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span>' t<sub>2</sub>" := (<a class="idref" href="MoreStlc.html#STLCExtended.multistep"><span class="id" title="abbreviation">multistep</span></a> <span class="id" title="var">t<sub>1</sub></span> <span class="id" title="var">t<sub>2</sub></span>) (<span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 40).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Hint Constructors</span> <a class="idref" href="MoreStlc.html#step"><span class="id" title="inductive">step</span></a> : <span class="id" title="var">core</span>.<br/>
</div>

<div class="doc">
<a id="lab281"></a><h3 class="section">Typing</h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.context" class="idref" href="#STLCExtended.context"><span class="id" title="definition">context</span></a> := <span class="id" title="definition">partial_map</span> <a class="idref" href="MoreStlc.html#STLCExtended.ty"><span class="id" title="inductive">ty</span></a>.<br/>
</div>

<div class="doc">
Next we define the typing rules.  These are nearly direct
    transcriptions of the inference rules shown above. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Reserved Notation</span> &quot;Gamma '&#x22A2;' t '&#x2208;' T" (<span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 40, <span class="id" title="var">t</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span>, <span class="id" title="var">T</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc_ty</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Inductive</span> <a id="STLCExtended.has_type" class="idref" href="#STLCExtended.has_type"><span class="id" title="inductive">has_type</span></a> : <a class="idref" href="MoreStlc.html#STLCExtended.context"><span class="id" title="definition">context</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.tm"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.ty"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <span class="id" title="keyword">Prop</span> :=<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;pure&nbsp;STLC&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.T_Var" class="idref" href="#STLCExtended.T_Var"><span class="id" title="constructor">T_Var</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:109" class="idref" href="#Gamma:109"><span class="id" title="binder">Gamma</span></a> <a id="x:110" class="idref" href="#x:110"><span class="id" title="binder">x</span></a> <a id="T<sub>1</sub>:111" class="idref" href="#T<sub>1</sub>:111"><span class="id" title="binder">T<sub>1</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:109"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#x:110"><span class="id" title="variable">x</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#Some"><span class="id" title="constructor">Some</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:111"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:109"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#x:110"><span class="id" title="variable">x</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:111"><span class="id" title="variable">T<sub>1</sub></span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.T_Abs" class="idref" href="#STLCExtended.T_Abs"><span class="id" title="constructor">T_Abs</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:112" class="idref" href="#Gamma:112"><span class="id" title="binder">Gamma</span></a> <a id="x:113" class="idref" href="#x:113"><span class="id" title="binder">x</span></a> <a id="T<sub>1</sub>:114" class="idref" href="#T<sub>1</sub>:114"><span class="id" title="binder">T<sub>1</sub></span></a> <a id="T<sub>2</sub>:115" class="idref" href="#T<sub>2</sub>:115"><span class="id" title="binder">T<sub>2</sub></span></a> <a id="t<sub>1</sub>:116" class="idref" href="#t<sub>1</sub>:116"><span class="id" title="binder">t<sub>1</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#x:113"><span class="id" title="variable">x</span></a> <span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>&#x22A2;</span><span style='font-size:90%;'>&gt;</span></span></span></span></span> <a class="idref" href="MoreStlc.html#T<sub>2</sub>:115"><span class="id" title="variable">T<sub>2</sub></span></a> <span class="id" title="notation">;</span> <a class="idref" href="MoreStlc.html#Gamma:112"><span class="id" title="variable">Gamma</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:116"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:114"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:112"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#x:113"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><a class="idref" href="MoreStlc.html#T<sub>2</sub>:115"><span class="id" title="variable">T<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:116"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#T<sub>2</sub>:115"><span class="id" title="variable">T<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:114"><span class="id" title="variable">T<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.T_App" class="idref" href="#STLCExtended.T_App"><span class="id" title="constructor">T_App</span></a> : <span class="id" title="keyword">∀</span> <a id="T<sub>1</sub>:117" class="idref" href="#T<sub>1</sub>:117"><span class="id" title="binder">T<sub>1</sub></span></a> <a id="T<sub>2</sub>:118" class="idref" href="#T<sub>2</sub>:118"><span class="id" title="binder">T<sub>2</sub></span></a> <a id="Gamma:119" class="idref" href="#Gamma:119"><span class="id" title="binder">Gamma</span></a> <a id="t<sub>1</sub>:120" class="idref" href="#t<sub>1</sub>:120"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:121" class="idref" href="#t<sub>2</sub>:121"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:119"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:120"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#T<sub>2</sub>:118"><span class="id" title="variable">T<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:117"><span class="id" title="variable">T<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:119"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:121"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>2</sub>:118"><span class="id" title="variable">T<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:119"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:120"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:121"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:117"><span class="id" title="variable">T<sub>1</sub></span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;numbers&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.T_Nat" class="idref" href="#STLCExtended.T_Nat"><span class="id" title="constructor">T_Nat</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:122" class="idref" href="#Gamma:122"><span class="id" title="binder">Gamma</span></a> (<a id="n:123" class="idref" href="#n:123"><span class="id" title="binder">n</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nat"><span class="id" title="inductive">nat</span></a>),<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:122"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#n:123"><span class="id" title="variable">n</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.T_Succ" class="idref" href="#STLCExtended.T_Succ"><span class="id" title="constructor">T_Succ</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:124" class="idref" href="#Gamma:124"><span class="id" title="binder">Gamma</span></a> <a id="t:125" class="idref" href="#t:125"><span class="id" title="binder">t</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:124"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t:125"><span class="id" title="variable">t</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:124"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'succ'_x"><span class="id" title="notation">succ</span></a> <a class="idref" href="MoreStlc.html#t:125"><span class="id" title="variable">t</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.T_Pred" class="idref" href="#STLCExtended.T_Pred"><span class="id" title="constructor">T_Pred</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:126" class="idref" href="#Gamma:126"><span class="id" title="binder">Gamma</span></a> <a id="t:127" class="idref" href="#t:127"><span class="id" title="binder">t</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:126"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t:127"><span class="id" title="variable">t</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:126"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">pred</span></a> <a class="idref" href="MoreStlc.html#t:127"><span class="id" title="variable">t</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.T_Mult" class="idref" href="#STLCExtended.T_Mult"><span class="id" title="constructor">T_Mult</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:128" class="idref" href="#Gamma:128"><span class="id" title="binder">Gamma</span></a> <a id="t<sub>1</sub>:129" class="idref" href="#t<sub>1</sub>:129"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:130" class="idref" href="#t<sub>2</sub>:130"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:128"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:129"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:128"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:130"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:128"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:129"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#43eb4b39e17c20cb1da938909e269aa<sub>6</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:130"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.T_If<sub>0</sub>" class="idref" href="#STLCExtended.T_If<sub>0</sub>"><span class="id" title="constructor">T_If<sub>0</sub></span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:131" class="idref" href="#Gamma:131"><span class="id" title="binder">Gamma</span></a> <a id="t<sub>1</sub>:132" class="idref" href="#t<sub>1</sub>:132"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:133" class="idref" href="#t<sub>2</sub>:133"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="t<sub>3</sub>:134" class="idref" href="#t<sub>3</sub>:134"><span class="id" title="binder">t<sub>3</sub></span></a> <a id="T<sub>0</sub>:135" class="idref" href="#T<sub>0</sub>:135"><span class="id" title="binder">T<sub>0</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:131"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:132"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:131"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:133"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>0</sub>:135"><span class="id" title="variable">T<sub>0</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:131"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>3</sub>:134"><span class="id" title="variable">t<sub>3</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>0</sub>:135"><span class="id" title="variable">T<sub>0</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:131"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:132"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:133"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="MoreStlc.html#t<sub>3</sub>:134"><span class="id" title="variable">t<sub>3</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>0</sub>:135"><span class="id" title="variable">T<sub>0</sub></span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;sums&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.T_Inl" class="idref" href="#STLCExtended.T_Inl"><span class="id" title="constructor">T_Inl</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:136" class="idref" href="#Gamma:136"><span class="id" title="binder">Gamma</span></a> <a id="t<sub>1</sub>:137" class="idref" href="#t<sub>1</sub>:137"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="T<sub>1</sub>:138" class="idref" href="#T<sub>1</sub>:138"><span class="id" title="binder">T<sub>1</sub></span></a> <a id="T<sub>2</sub>:139" class="idref" href="#T<sub>2</sub>:139"><span class="id" title="binder">T<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:136"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:137"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:138"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:136"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inl'_x_x"><span class="id" title="notation">inl</span></a> <a class="idref" href="MoreStlc.html#T<sub>2</sub>:139"><span class="id" title="variable">T<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:137"><span class="id" title="variable">t<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#T<sub>1</sub>:138"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#8d02d86020db13ec74895c11a9bd9e<sub>25</sub>"><span class="id" title="notation">+</span></a> <a class="idref" href="MoreStlc.html#T<sub>2</sub>:139"><span class="id" title="variable">T<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.T_Inr" class="idref" href="#STLCExtended.T_Inr"><span class="id" title="constructor">T_Inr</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:140" class="idref" href="#Gamma:140"><span class="id" title="binder">Gamma</span></a> <a id="t<sub>2</sub>:141" class="idref" href="#t<sub>2</sub>:141"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="T<sub>1</sub>:142" class="idref" href="#T<sub>1</sub>:142"><span class="id" title="binder">T<sub>1</sub></span></a> <a id="T<sub>2</sub>:143" class="idref" href="#T<sub>2</sub>:143"><span class="id" title="binder">T<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:140"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:141"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>2</sub>:143"><span class="id" title="variable">T<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:140"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inr'_x_x"><span class="id" title="notation">inr</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:142"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:141"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#T<sub>1</sub>:142"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#8d02d86020db13ec74895c11a9bd9e<sub>25</sub>"><span class="id" title="notation">+</span></a> <a class="idref" href="MoreStlc.html#T<sub>2</sub>:143"><span class="id" title="variable">T<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.T_Case" class="idref" href="#STLCExtended.T_Case"><span class="id" title="constructor">T_Case</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:144" class="idref" href="#Gamma:144"><span class="id" title="binder">Gamma</span></a> <a id="t<sub>0</sub>:145" class="idref" href="#t<sub>0</sub>:145"><span class="id" title="binder">t<sub>0</sub></span></a> <a id="x<sub>1</sub>:146" class="idref" href="#x<sub>1</sub>:146"><span class="id" title="binder">x<sub>1</sub></span></a> <a id="T<sub>1</sub>:147" class="idref" href="#T<sub>1</sub>:147"><span class="id" title="binder">T<sub>1</sub></span></a> <a id="t<sub>1</sub>:148" class="idref" href="#t<sub>1</sub>:148"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="x<sub>2</sub>:149" class="idref" href="#x<sub>2</sub>:149"><span class="id" title="binder">x<sub>2</sub></span></a> <a id="T<sub>2</sub>:150" class="idref" href="#T<sub>2</sub>:150"><span class="id" title="binder">T<sub>2</sub></span></a> <a id="t<sub>2</sub>:151" class="idref" href="#t<sub>2</sub>:151"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="T<sub>3</sub>:152" class="idref" href="#T<sub>3</sub>:152"><span class="id" title="binder">T<sub>3</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:144"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>0</sub>:145"><span class="id" title="variable">t<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#T<sub>1</sub>:147"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#8d02d86020db13ec74895c11a9bd9e<sub>25</sub>"><span class="id" title="notation">+</span></a> <a class="idref" href="MoreStlc.html#T<sub>2</sub>:150"><span class="id" title="variable">T<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#x<sub>1</sub>:146"><span class="id" title="variable">x<sub>1</sub></span></a> <span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>&#x22A2;</span><span style='font-size:90%;'>&gt;</span></span></span></span></span> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:147"><span class="id" title="variable">T<sub>1</sub></span></a> <span class="id" title="notation">;</span> <a class="idref" href="MoreStlc.html#Gamma:144"><span class="id" title="variable">Gamma</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:148"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>3</sub>:152"><span class="id" title="variable">T<sub>3</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#x<sub>2</sub>:149"><span class="id" title="variable">x<sub>2</sub></span></a> <span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>&#x22A2;</span><span style='font-size:90%;'>&gt;</span></span></span></span></span> <a class="idref" href="MoreStlc.html#T<sub>2</sub>:150"><span class="id" title="variable">T<sub>2</sub></span></a> <span class="id" title="notation">;</span> <a class="idref" href="MoreStlc.html#Gamma:144"><span class="id" title="variable">Gamma</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:151"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>3</sub>:152"><span class="id" title="variable">T<sub>3</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:144"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#t<sub>0</sub>:145"><span class="id" title="variable">t<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">of</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inl</span></a> <a class="idref" href="MoreStlc.html#x<sub>1</sub>:146"><span class="id" title="variable">x<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:148"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inr</span></a> <a class="idref" href="MoreStlc.html#x<sub>2</sub>:149"><span class="id" title="variable">x<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:151"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>3</sub>:152"><span class="id" title="variable">T<sub>3</sub></span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;lists&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.T_Nil" class="idref" href="#STLCExtended.T_Nil"><span class="id" title="constructor">T_Nil</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:153" class="idref" href="#Gamma:153"><span class="id" title="binder">Gamma</span></a> <a id="T<sub>1</sub>:154" class="idref" href="#T<sub>1</sub>:154"><span class="id" title="binder">T<sub>1</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:153"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'nil'_x"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:154"><span class="id" title="variable">T<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'List'_x"><span class="id" title="notation">List</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:154"><span class="id" title="variable">T<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.T_Cons" class="idref" href="#STLCExtended.T_Cons"><span class="id" title="constructor">T_Cons</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:155" class="idref" href="#Gamma:155"><span class="id" title="binder">Gamma</span></a> <a id="t<sub>1</sub>:156" class="idref" href="#t<sub>1</sub>:156"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:157" class="idref" href="#t<sub>2</sub>:157"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="T<sub>1</sub>:158" class="idref" href="#T<sub>1</sub>:158"><span class="id" title="binder">T<sub>1</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:155"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:156"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:158"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:155"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:157"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'List'_x"><span class="id" title="notation">List</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:158"><span class="id" title="variable">T<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:155"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#t<sub>1</sub>:156"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:157"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'List'_x"><span class="id" title="notation">List</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:158"><span class="id" title="variable">T<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a><br/>
&nbsp;&nbsp;| <a id="STLCExtended.T_Lcase" class="idref" href="#STLCExtended.T_Lcase"><span class="id" title="constructor">T_Lcase</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:159" class="idref" href="#Gamma:159"><span class="id" title="binder">Gamma</span></a> <a id="t<sub>1</sub>:160" class="idref" href="#t<sub>1</sub>:160"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="T<sub>1</sub>:161" class="idref" href="#T<sub>1</sub>:161"><span class="id" title="binder">T<sub>1</sub></span></a> <a id="t<sub>2</sub>:162" class="idref" href="#t<sub>2</sub>:162"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="x<sub>1</sub>:163" class="idref" href="#x<sub>1</sub>:163"><span class="id" title="binder">x<sub>1</sub></span></a> <a id="x<sub>2</sub>:164" class="idref" href="#x<sub>2</sub>:164"><span class="id" title="binder">x<sub>2</sub></span></a> <a id="t<sub>3</sub>:165" class="idref" href="#t<sub>3</sub>:165"><span class="id" title="binder">t<sub>3</sub></span></a> <a id="T<sub>2</sub>:166" class="idref" href="#T<sub>2</sub>:166"><span class="id" title="binder">T<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:159"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:160"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'List'_x"><span class="id" title="notation">List</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:161"><span class="id" title="variable">T<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:159"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:162"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>2</sub>:166"><span class="id" title="variable">T<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#x<sub>1</sub>:163"><span class="id" title="variable">x<sub>1</sub></span></a> <span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>&#x22A2;</span><span style='font-size:90%;'>&gt;</span></span></span></span></span> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:161"><span class="id" title="variable">T<sub>1</sub></span></a> <span class="id" title="notation">;</span> <a class="idref" href="MoreStlc.html#x<sub>2</sub>:164"><span class="id" title="variable">x<sub>2</sub></span></a> <span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>&#x22A2;</span><span style='font-size:90%;'>&gt;</span></span></span></span></span> <a class="idref" href="MoreStlc.html#4790eac4da69227166d84a2e2fa965df"><span class="id" title="notation">&lt;<span style='letter-spacing:-.4em;'>{</span>{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'List'_x"><span class="id" title="notation">List</span></a> <a class="idref" href="MoreStlc.html#T<sub>1</sub>:161"><span class="id" title="variable">T<sub>1</sub></span></a><a class="idref" href="MoreStlc.html#4790eac4da69227166d84a2e2fa965df"><span class="id" title="notation"><span style='letter-spacing:-.4em;'>}</span>}&gt;</span></a> <span class="id" title="notation">;</span> <a class="idref" href="MoreStlc.html#Gamma:159"><span class="id" title="variable">Gamma</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t<sub>3</sub>:165"><span class="id" title="variable">t<sub>3</sub></span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>2</sub>:166"><span class="id" title="variable">T<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:159"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#t<sub>1</sub>:160"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">of</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>2</sub>:162"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#x<sub>1</sub>:163"><span class="id" title="variable">x<sub>1</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#x<sub>2</sub>:164"><span class="id" title="variable">x<sub>2</sub></span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#t<sub>3</sub>:165"><span class="id" title="variable">t<sub>3</sub></span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T<sub>2</sub>:166"><span class="id" title="variable">T<sub>2</sub></span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;unit&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="STLCExtended.T_Unit" class="idref" href="#STLCExtended.T_Unit"><span class="id" title="constructor">T_Unit</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:167" class="idref" href="#Gamma:167"><span class="id" title="binder">Gamma</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:167"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'unit'"><span class="id" title="notation">unit</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Unit'"><span class="id" title="notation">Unit</span></a><br/>
<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;Add&nbsp;rules&nbsp;for&nbsp;the&nbsp;following&nbsp;extensions.&nbsp;*)</span><br/>
<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;pairs&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;let&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;fix&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
<br/>
<span class="id" title="keyword">where</span> <a id="93ddac5fbc94395177f473c7b12aad0d" class="idref" href="#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&quot;</span></a>Gamma '&#x22A2;' t '&#x2208;' T" := (<a class="idref" href="MoreStlc.html#has_type:108"><span class="id" title="inductive">has_type</span></a> <span class="id" title="var">Gamma</span> <span class="id" title="var">t</span> <span class="id" title="var">T</span>).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Hint Constructors</span> <a class="idref" href="MoreStlc.html#has_type"><span class="id" title="inductive">has_type</span></a> : <span class="id" title="var">core</span>.<br/><hr class='doublespaceincode'/>
<span class="comment">(*&nbsp;Do&nbsp;not&nbsp;modify&nbsp;the&nbsp;following&nbsp;line:&nbsp;*)</span><br/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.manual_grade_for_extensions_definition" class="idref" href="#STLCExtended.manual_grade_for_extensions_definition"><span class="id" title="definition">manual_grade_for_extensions_definition</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#option"><span class="id" title="inductive">option</span></a> (<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nat"><span class="id" title="inductive">nat</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac<sub>4</sub>"><span class="id" title="notation">×</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a>) := <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#None"><span class="id" title="constructor">None</span></a>.<br/>
<font size=-2>&#9744;</font>
</div>


<div class="doc">
<a id="lab282"></a><h2 class="section">Examples</h2>

<div class="paragraph"> </div>

<a id="lab283"></a><h4 class="section">Exercise: 3 stars, standard (STLCE_examples)</h4>
 This section presents formalized versions of the examples from
    above (plus several more).

<div class="paragraph"> </div>

    For each example, uncomment proofs and replace <span class="inlinecode"><span class="id" title="var">Admitted</span></span> by
    <span class="inlinecode"><span class="id" title="keyword">Qed</span></span> once you've implemented enough of the definitions for
    the tests to pass.

<div class="paragraph"> </div>

    The examples at the beginning focus on specific features; you can
    use these to make sure your definition of a given feature is
    reasonable before moving on to extending the proofs later in the
    file with the cases relating to this feature.
    The later examples require all the features together, so you'll
    need to come back to these when you've got all the definitions
    filled in. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Module</span> <a id="STLCExtended.Examples" class="idref" href="#STLCExtended.Examples"><span class="id" title="module">Examples</span></a>.<br/>
</div>

<div class="doc">
<a id="lab284"></a><h3 class="section">Preliminaries</h3>

<div class="paragraph"> </div>

 First, let's define a few variable names: 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Open</span> <span class="id" title="keyword">Scope</span> <span class="id" title="var">string_scope</span>.<br/>
<span class="comment">(*&nbsp;&nbsp;NOTATION:&nbsp;LATER:&nbsp;These&nbsp;can&nbsp;all&nbsp;be&nbsp;Notations&nbsp;--&nbsp;just&nbsp;make&nbsp;sure&nbsp;to&nbsp;add&nbsp;a<br/>
&nbsp;&nbsp;&nbsp;<span class="inlinecode"><span class="id" title="keyword">Hint</span></span> <span class="inlinecode"><span class="id" title="keyword">Unfold</span></span>&nbsp;for&nbsp;each&nbsp;one.&nbsp;*)</span><br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.x" class="idref" href="#STLCExtended.Examples.x"><span class="id" title="abbreviation">x</span></a> := "x".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.y" class="idref" href="#STLCExtended.Examples.y"><span class="id" title="abbreviation">y</span></a> := "y".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.a" class="idref" href="#STLCExtended.Examples.a"><span class="id" title="abbreviation">a</span></a> := "a".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.f" class="idref" href="#STLCExtended.Examples.f"><span class="id" title="abbreviation">f</span></a> := "f".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.g" class="idref" href="#STLCExtended.Examples.g"><span class="id" title="abbreviation">g</span></a> := "g".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.l" class="idref" href="#STLCExtended.Examples.l"><span class="id" title="abbreviation">l</span></a> := "l".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.k" class="idref" href="#STLCExtended.Examples.k"><span class="id" title="abbreviation">k</span></a> := "k".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.i1" class="idref" href="#STLCExtended.Examples.i1"><span class="id" title="abbreviation">i<sub>1</sub></span></a> := "i<sub>1</sub>".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.i2" class="idref" href="#STLCExtended.Examples.i2"><span class="id" title="abbreviation">i<sub>2</sub></span></a> := "i<sub>2</sub>".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.processSum" class="idref" href="#STLCExtended.Examples.processSum"><span class="id" title="abbreviation">processSum</span></a> := "processSum".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.n" class="idref" href="#STLCExtended.Examples.n"><span class="id" title="abbreviation">n</span></a> := "n".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.eq" class="idref" href="#STLCExtended.Examples.eq"><span class="id" title="abbreviation">eq</span></a> := "eq".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.m" class="idref" href="#STLCExtended.Examples.m"><span class="id" title="abbreviation">m</span></a> := "m".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.evenodd" class="idref" href="#STLCExtended.Examples.evenodd"><span class="id" title="abbreviation">evenodd</span></a> := "evenodd".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.even" class="idref" href="#STLCExtended.Examples.even"><span class="id" title="abbreviation">even</span></a> := "even".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.odd" class="idref" href="#STLCExtended.Examples.odd"><span class="id" title="abbreviation">odd</span></a> := "odd".<br/>
<span class="id" title="keyword">Notation</span> <a id="STLCExtended.Examples.eo" class="idref" href="#STLCExtended.Examples.eo"><span class="id" title="abbreviation">eo</span></a> := "eo".<br/>
</div>

<div class="doc">
Next, a bit of Coq hackery to automate searching for typing
    derivations.  You don't need to understand this bit in detail --
    just have a look over it so that you'll know what to look for if
    you ever find yourself needing to make custom extensions to
    <span class="inlinecode"><span class="id" title="tactic">auto</span></span>.

<div class="paragraph"> </div>

    The following <span class="inlinecode"><span class="id" title="keyword">Hint</span></span> declarations say that, whenever <span class="inlinecode"><span class="id" title="tactic">auto</span></span>
    arrives at a goal of the form <span class="inlinecode">(<span class="id" title="var">Gamma</span></span> <span class="inlinecode">&#x22A2;</span> <span class="inlinecode">(<span class="id" title="var">tm_app</span></span> <span class="inlinecode"><span class="id" title="var">e<sub>1</sub></span></span> <span class="inlinecode"><span class="id" title="var">e<sub>1</sub></span>)</span> <span class="inlinecode">\<span class="id" title="tactic">in</span></span> <span class="inlinecode"><span class="id" title="var">T</span>)</span>, it
    should consider <span class="inlinecode"><span class="id" title="tactic">eapply</span></span> <span class="inlinecode"><span class="id" title="var">T_App</span></span>, leaving an existential variable
    for the middle type T<sub>1</sub>, and similar for <span class="inlinecode"><span class="id" title="var">lcase</span></span>. That variable
    will then be filled in during the search for type derivations for
    <span class="inlinecode"><span class="id" title="var">e<sub>1</sub></span></span> and <span class="inlinecode"><span class="id" title="var">e<sub>2</sub></span></span>.  We also include a hint to "try harder" when
    solving equality goals; this is useful to automate uses of
    <span class="inlinecode"><span class="id" title="var">T_Var</span></span> (which includes an equality as a precondition). 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Hint Extern</span> 2 (<a class="idref" href="MoreStlc.html#STLCExtended.has_type"><span class="id" title="inductive">has_type</span></a> <span class="id" title="var">_</span> (<a class="idref" href="MoreStlc.html#STLCExtended.tm_app"><span class="id" title="constructor">tm_app</span></a> <span class="id" title="var">_</span> <span class="id" title="var">_</span>) <span class="id" title="var">_</span>) ⇒<br/>
&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="MoreStlc.html#STLCExtended.T_App"><span class="id" title="constructor">T_App</span></a>; <span class="id" title="tactic">auto</span> : <span class="id" title="var">core</span>.<br/>
<span class="id" title="keyword">Hint Extern</span> 2 (<a class="idref" href="MoreStlc.html#STLCExtended.has_type"><span class="id" title="inductive">has_type</span></a> <span class="id" title="var">_</span> (<a class="idref" href="MoreStlc.html#STLCExtended.tm_lcase"><span class="id" title="constructor">tm_lcase</span></a> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span>) <span class="id" title="var">_</span>) ⇒<br/>
&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="MoreStlc.html#STLCExtended.T_Lcase"><span class="id" title="constructor">T_Lcase</span></a>; <span class="id" title="tactic">auto</span> : <span class="id" title="var">core</span>.<br/>
<span class="id" title="keyword">Hint Extern</span> 2 (<span class="id" title="var">_</span> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <span class="id" title="var">_</span>) ⇒ <span class="id" title="tactic">compute</span>; <span class="id" title="tactic">reflexivity</span> : <span class="id" title="var">core</span>.<br/>
</div>

<div class="doc">
<a id="lab285"></a><h3 class="section">Numbers</h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Module</span> <a id="STLCExtended.Examples.Numtest" class="idref" href="#STLCExtended.Examples.Numtest"><span class="id" title="module">Numtest</span></a>.<br/><hr class='doublespaceincode'/>
<span class="comment">(*&nbsp;tm_test0&nbsp;(pred&nbsp;(succ&nbsp;(pred&nbsp;(2&nbsp;*&nbsp;0)))&nbsp;then&nbsp;5&nbsp;else&nbsp;6&nbsp;*)</span><br/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.Examples.Numtest.test" class="idref" href="#STLCExtended.Examples.Numtest.test"><span class="id" title="definition">test</span></a> :=<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">pred</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'succ'_x"><span class="id" title="notation">succ</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">pred</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a>2 <a class="idref" href="MoreStlc.html#43eb4b39e17c20cb1da938909e269aa<sub>6</sub>"><span class="id" title="notation">×</span></a> 0<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">))))</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> 5<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> 6<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.Numtest.typechecks" class="idref" href="#STLCExtended.Examples.Numtest.typechecks"><span class="id" title="definition">typechecks</span></a> :<br/>
&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.Numtest.test"><span class="id" title="definition">test</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">unfold</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.Numtest.test"><span class="id" title="definition">test</span></a>.<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;This&nbsp;typing&nbsp;derivation&nbsp;is&nbsp;quite&nbsp;deep,&nbsp;so&nbsp;we&nbsp;need<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;increase&nbsp;the&nbsp;max&nbsp;search&nbsp;depth&nbsp;of&nbsp;<span class="inlinecode"><span class="id" title="tactic">auto</span></span>&nbsp;from&nbsp;the<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default&nbsp;5&nbsp;to&nbsp;10.&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="id" title="tactic">auto</span> 10.<br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.Numtest.numtest_reduces" class="idref" href="#STLCExtended.Examples.Numtest.numtest_reduces"><span class="id" title="definition">numtest_reduces</span></a> :<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.Examples.Numtest.test"><span class="id" title="definition">test</span></a> <a class="idref" href="MoreStlc.html#9cd10f7cb4dfdde0d448b6577b0f7bdd"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> 5.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="comment">(*&nbsp;<br/>
&nbsp;&nbsp;unfold&nbsp;test.&nbsp;normalize.<br/>
*)</span><br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">End</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.Numtest"><span class="id" title="module">Numtest</span></a>.<br/>
</div>

<div class="doc">
<a id="lab286"></a><h3 class="section">Products</h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Module</span> <a id="STLCExtended.Examples.Prodtest" class="idref" href="#STLCExtended.Examples.Prodtest"><span class="id" title="module">Prodtest</span></a>.<br/><hr class='doublespaceincode'/>
<span class="comment">(*&nbsp;((5,6),7).fst.tm_snd&nbsp;*)</span><br/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.Examples.Prodtest.test" class="idref" href="#STLCExtended.Examples.Prodtest.test"><span class="id" title="definition">test</span></a> :=<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">((</span></a>5<a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">,</span></a>6<a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">),</span></a>7<a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'.fst'"><span class="id" title="notation">.</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'.fst'"><span class="id" title="notation">fst.snd</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.Prodtest.typechecks" class="idref" href="#STLCExtended.Examples.Prodtest.typechecks"><span class="id" title="definition">typechecks</span></a> :<br/>
&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.Prodtest.test"><span class="id" title="definition">test</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a>.<br/>
<span class="id" title="keyword">Proof</span>. <span class="id" title="tactic">unfold</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.Prodtest.test"><span class="id" title="definition">test</span></a>. <span class="id" title="tactic">eauto</span> 15. <span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
<span class="comment">(*&nbsp;GRADE_THEOREM&nbsp;0.25:&nbsp;typechecks&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.Prodtest.reduces" class="idref" href="#STLCExtended.Examples.Prodtest.reduces"><span class="id" title="definition">reduces</span></a> :<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.Examples.Prodtest.test"><span class="id" title="definition">test</span></a> <a class="idref" href="MoreStlc.html#9cd10f7cb4dfdde0d448b6577b0f7bdd"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> 6.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="comment">(*&nbsp;<br/>
&nbsp;&nbsp;unfold&nbsp;test.&nbsp;normalize.<br/>
*)</span><br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
<span class="comment">(*&nbsp;GRADE_THEOREM&nbsp;0.25:&nbsp;reduces&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">End</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.Prodtest"><span class="id" title="module">Prodtest</span></a>.<br/>
</div>

<div class="doc">
<a id="lab287"></a><h3 class="section"><span class="inlinecode"><span class="id" title="keyword">let</span></span></h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Module</span> <a id="STLCExtended.Examples.LetTest" class="idref" href="#STLCExtended.Examples.LetTest"><span class="id" title="module">LetTest</span></a>.<br/><hr class='doublespaceincode'/>
<span class="comment">(*&nbsp;let&nbsp;x&nbsp;=&nbsp;pred&nbsp;6&nbsp;in&nbsp;succ&nbsp;x&nbsp;*)</span><br/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.Examples.LetTest.test" class="idref" href="#STLCExtended.Examples.LetTest.test"><span class="id" title="definition">test</span></a> :=<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">let</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.x"><span class="id" title="abbreviation">x</span></a> <a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">=</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">pred</span></a> 6<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">in</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'succ'_x"><span class="id" title="notation">succ</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.x"><span class="id" title="abbreviation">x</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.LetTest.typechecks" class="idref" href="#STLCExtended.Examples.LetTest.typechecks"><span class="id" title="definition">typechecks</span></a> :<br/>
&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.LetTest.test"><span class="id" title="definition">test</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a>.<br/>
<span class="id" title="keyword">Proof</span>. <span class="id" title="tactic">unfold</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.LetTest.test"><span class="id" title="definition">test</span></a>. <span class="id" title="tactic">eauto</span> 15. <span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
<span class="comment">(*&nbsp;GRADE_THEOREM&nbsp;0.25:&nbsp;typechecks&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.LetTest.reduces" class="idref" href="#STLCExtended.Examples.LetTest.reduces"><span class="id" title="definition">reduces</span></a> :<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.Examples.LetTest.test"><span class="id" title="definition">test</span></a> <a class="idref" href="MoreStlc.html#9cd10f7cb4dfdde0d448b6577b0f7bdd"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> 6.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="comment">(*&nbsp;<br/>
&nbsp;&nbsp;unfold&nbsp;test.&nbsp;normalize.<br/>
*)</span><br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
<span class="comment">(*&nbsp;GRADE_THEOREM&nbsp;0.25:&nbsp;reduces&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">End</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.LetTest"><span class="id" title="module">LetTest</span></a>.<br/>
</div>

<div class="doc">
<a id="lab288"></a><h3 class="section">Sums</h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Module</span> <a id="STLCExtended.Examples.Sumtest1" class="idref" href="#STLCExtended.Examples.Sumtest1"><span class="id" title="module">Sumtest1</span></a>.<br/><hr class='doublespaceincode'/>
<span class="comment">(*&nbsp;case&nbsp;(inl&nbsp;Nat&nbsp;5)&nbsp;of<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inl&nbsp;x&nbsp;=&gt;&nbsp;x<br/>
&nbsp;&nbsp;&nbsp;|&nbsp;inr&nbsp;y&nbsp;=&gt;&nbsp;y&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.Examples.Sumtest1.test" class="idref" href="#STLCExtended.Examples.Sumtest1.test"><span class="id" title="definition">test</span></a> :=<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inl'_x_x"><span class="id" title="notation">inl</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> 5<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">of</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inl</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.x"><span class="id" title="abbreviation">x</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.x"><span class="id" title="abbreviation">x</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inr</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.y"><span class="id" title="abbreviation">y</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.y"><span class="id" title="abbreviation">y</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.Sumtest1.typechecks" class="idref" href="#STLCExtended.Examples.Sumtest1.typechecks"><span class="id" title="definition">typechecks</span></a> :<br/>
&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.Sumtest1.test"><span class="id" title="definition">test</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a>.<br/>
<span class="id" title="keyword">Proof</span>. <span class="id" title="tactic">unfold</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.Sumtest1.test"><span class="id" title="definition">test</span></a>. <span class="id" title="tactic">eauto</span> 15. <span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.Sumtest1.reduces" class="idref" href="#STLCExtended.Examples.Sumtest1.reduces"><span class="id" title="definition">reduces</span></a> :<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.Examples.Sumtest1.test"><span class="id" title="definition">test</span></a> <a class="idref" href="MoreStlc.html#9cd10f7cb4dfdde0d448b6577b0f7bdd"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> 5.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="comment">(*&nbsp;<br/>
&nbsp;&nbsp;unfold&nbsp;test.&nbsp;normalize.<br/>
*)</span><br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">End</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.Sumtest1"><span class="id" title="module">Sumtest1</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Module</span> <a id="STLCExtended.Examples.Sumtest2" class="idref" href="#STLCExtended.Examples.Sumtest2"><span class="id" title="module">Sumtest2</span></a>.<br/><hr class='doublespaceincode'/>
<span class="comment">(*&nbsp;let&nbsp;processSum&nbsp;=<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\x:Nat+Nat.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;x&nbsp;of<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inl&nbsp;n&nbsp;=&gt;&nbsp;n<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inr&nbsp;n&nbsp;=&gt;&nbsp;tm_test0&nbsp;n&nbsp;then&nbsp;1&nbsp;else&nbsp;0&nbsp;in<br/>
&nbsp;&nbsp;&nbsp;(processSum&nbsp;(inl&nbsp;Nat&nbsp;5),&nbsp;processSum&nbsp;(inr&nbsp;Nat&nbsp;5))&nbsp;&nbsp;&nbsp;&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.Examples.Sumtest2.test" class="idref" href="#STLCExtended.Examples.Sumtest2.test"><span class="id" title="definition">test</span></a> :=<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">let</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.processSum"><span class="id" title="abbreviation">processSum</span></a> <a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">=</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.x"><span class="id" title="abbreviation">x</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> <a class="idref" href="MoreStlc.html#8d02d86020db13ec74895c11a9bd9e<sub>25</sub>"><span class="id" title="notation">+</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.x"><span class="id" title="abbreviation">x</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">of</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inl</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.n"><span class="id" title="abbreviation">n</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.n"><span class="id" title="abbreviation">n</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inr</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.n"><span class="id" title="abbreviation">n</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.n"><span class="id" title="abbreviation">n</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> 1 <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> 0<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">))</span></a> <a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">in</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.processSum"><span class="id" title="abbreviation">processSum</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inl'_x_x"><span class="id" title="notation">inl</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> 5<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">,</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.processSum"><span class="id" title="abbreviation">processSum</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'inr'_x_x"><span class="id" title="notation">inr</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> 5<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.Sumtest2.typechecks" class="idref" href="#STLCExtended.Examples.Sumtest2.typechecks"><span class="id" title="definition">typechecks</span></a> :<br/>
&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.Sumtest2.test"><span class="id" title="definition">test</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> <a class="idref" href="MoreStlc.html#07385bcfe759c5c52b9f596e53f2c0f<sub>5</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a>.<br/>
<span class="id" title="keyword">Proof</span>. <span class="id" title="tactic">unfold</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.Sumtest2.test"><span class="id" title="definition">test</span></a>. <span class="id" title="tactic">eauto</span> 15. <span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.Sumtest2.reduces" class="idref" href="#STLCExtended.Examples.Sumtest2.reduces"><span class="id" title="definition">reduces</span></a> :<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.Examples.Sumtest2.test"><span class="id" title="definition">test</span></a> <a class="idref" href="MoreStlc.html#9cd10f7cb4dfdde0d448b6577b0f7bdd"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">(</span></a>5<a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">,</span></a> 0<a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="comment">(*&nbsp;<br/>
&nbsp;&nbsp;unfold&nbsp;test.&nbsp;normalize.<br/>
*)</span><br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">End</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.Sumtest2"><span class="id" title="module">Sumtest2</span></a>.<br/>
</div>

<div class="doc">
<a id="lab289"></a><h3 class="section">Lists</h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Module</span> <a id="STLCExtended.Examples.ListTest" class="idref" href="#STLCExtended.Examples.ListTest"><span class="id" title="module">ListTest</span></a>.<br/><hr class='doublespaceincode'/>
<span class="comment">(*&nbsp;let&nbsp;l&nbsp;=&nbsp;cons&nbsp;5&nbsp;(cons&nbsp;6&nbsp;(nil&nbsp;Nat))&nbsp;in<br/>
&nbsp;&nbsp;&nbsp;case&nbsp;l&nbsp;of<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nil&nbsp;=&gt;&nbsp;0<br/>
&nbsp;&nbsp;&nbsp;|&nbsp;x::y&nbsp;=&gt;&nbsp;x*x&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.Examples.ListTest.test" class="idref" href="#STLCExtended.Examples.ListTest.test"><span class="id" title="definition">test</span></a> :=<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">let</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.l"><span class="id" title="abbreviation">l</span></a> <a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">=</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a>5 <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> 6 <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'nil'_x"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">))</span></a> <a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">in</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.l"><span class="id" title="abbreviation">l</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">of</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> 0<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.x"><span class="id" title="abbreviation">x</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.y"><span class="id" title="abbreviation">y</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.x"><span class="id" title="abbreviation">x</span></a> <a class="idref" href="MoreStlc.html#43eb4b39e17c20cb1da938909e269aa<sub>6</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.x"><span class="id" title="abbreviation">x</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.ListTest.typechecks" class="idref" href="#STLCExtended.Examples.ListTest.typechecks"><span class="id" title="definition">typechecks</span></a> :<br/>
&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.ListTest.test"><span class="id" title="definition">test</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a>.<br/>
<span class="id" title="keyword">Proof</span>. <span class="id" title="tactic">unfold</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.ListTest.test"><span class="id" title="definition">test</span></a>. <span class="id" title="tactic">eauto</span> 20. <span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.ListTest.reduces" class="idref" href="#STLCExtended.Examples.ListTest.reduces"><span class="id" title="definition">reduces</span></a> :<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.Examples.ListTest.test"><span class="id" title="definition">test</span></a> <a class="idref" href="MoreStlc.html#9cd10f7cb4dfdde0d448b6577b0f7bdd"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> 25.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="comment">(*&nbsp;<br/>
&nbsp;&nbsp;unfold&nbsp;test.&nbsp;normalize.<br/>
*)</span><br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">End</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.ListTest"><span class="id" title="module">ListTest</span></a>.<br/>
</div>

<div class="doc">
<a id="lab290"></a><h3 class="section"><span class="inlinecode"><span class="id" title="keyword">fix</span></span></h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Module</span> <a id="STLCExtended.Examples.FixTest1" class="idref" href="#STLCExtended.Examples.FixTest1"><span class="id" title="module">FixTest1</span></a>.<br/><hr class='doublespaceincode'/>
<span class="comment">(*&nbsp;fact&nbsp;:=&nbsp;fix<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(\f:nat<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>nat.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\a:nat.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;test&nbsp;a=0&nbsp;then&nbsp;1&nbsp;else&nbsp;a&nbsp;*&nbsp;(f&nbsp;(pred&nbsp;a)))&nbsp;*)</span><br/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.Examples.FixTest1.fact" class="idref" href="#STLCExtended.Examples.FixTest1.fact"><span class="id" title="definition">fact</span></a> :=<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'fix'_x"><span class="id" title="notation">fix</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.f"><span class="id" title="abbreviation">f</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">→</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.a"><span class="id" title="abbreviation">a</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.a"><span class="id" title="abbreviation">a</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> 1 <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.a"><span class="id" title="abbreviation">a</span></a> <a class="idref" href="MoreStlc.html#43eb4b39e17c20cb1da938909e269aa<sub>6</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.f"><span class="id" title="abbreviation">f</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">pred</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.a"><span class="id" title="abbreviation">a</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">))))</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>.<br/>
</div>

<div class="doc">
(Warning: you may be able to typecheck <span class="inlinecode"><span class="id" title="var">fact</span></span> but still have some
    rules wrong!) 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.FixTest1.typechecks" class="idref" href="#STLCExtended.Examples.FixTest1.typechecks"><span class="id" title="definition">typechecks</span></a> :<br/>
&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest1.fact"><span class="id" title="definition">fact</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a>.<br/>
<span class="id" title="keyword">Proof</span>. <span class="id" title="tactic">unfold</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest1.fact"><span class="id" title="definition">fact</span></a>. <span class="id" title="tactic">auto</span> 10. <span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
<span class="comment">(*&nbsp;GRADE_THEOREM&nbsp;0.25:&nbsp;typechecks&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.FixTest1.reduces" class="idref" href="#STLCExtended.Examples.FixTest1.reduces"><span class="id" title="definition">reduces</span></a> :<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest1.fact"><span class="id" title="definition">fact</span></a> 4<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#9cd10f7cb4dfdde0d448b6577b0f7bdd"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> 24.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="comment">(*&nbsp;<br/>
&nbsp;&nbsp;unfold&nbsp;fact.&nbsp;normalize.<br/>
*)</span><br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
<span class="comment">(*&nbsp;GRADE_THEOREM&nbsp;0.25:&nbsp;reduces&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">End</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest1"><span class="id" title="module">FixTest1</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Module</span> <a id="STLCExtended.Examples.FixTest2" class="idref" href="#STLCExtended.Examples.FixTest2"><span class="id" title="module">FixTest2</span></a>.<br/><hr class='doublespaceincode'/>
<span class="comment">(*&nbsp;map&nbsp;:=<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\g:nat<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>nat.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fix<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(\f:<span class="inlinecode"><span class="id" title="var">nat</span></span><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span><span class="inlinecode"><span class="id" title="var">nat</span></span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\l:<span class="inlinecode"><span class="id" title="var">nat</span></span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;l&nbsp;of<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;<span class="inlinecode"></span>&nbsp;<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>&nbsp;<span class="inlinecode"></span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;x::l&nbsp;<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>&nbsp;(g&nbsp;x)::(f&nbsp;l))&nbsp;*)</span><br/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.Examples.FixTest2.map" class="idref" href="#STLCExtended.Examples.FixTest2.map"><span class="id" title="definition">map</span></a> :=<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.g"><span class="id" title="abbreviation">g</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">→</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'fix'_x"><span class="id" title="notation">fix</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.f"><span class="id" title="abbreviation">f</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'List'_x"><span class="id" title="notation">List</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">→</span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'List'_x"><span class="id" title="notation">List</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.l"><span class="id" title="abbreviation">l</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'List'_x"><span class="id" title="notation">List</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">case</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.l"><span class="id" title="abbreviation">l</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">of</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'nil'_x"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.x"><span class="id" title="abbreviation">x</span></a><a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">::</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.l"><span class="id" title="abbreviation">l</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">((</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.g"><span class="id" title="abbreviation">g</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.x"><span class="id" title="abbreviation">x</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.f"><span class="id" title="abbreviation">f</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.l"><span class="id" title="abbreviation">l</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)))</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.FixTest2.typechecks" class="idref" href="#STLCExtended.Examples.FixTest2.typechecks"><span class="id" title="definition">typechecks</span></a> :<br/>
&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest2.map"><span class="id" title="definition">map</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">((</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">((</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'List'_x"><span class="id" title="notation">List</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'List'_x"><span class="id" title="notation">List</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)))</span></a>.<br/>
<span class="id" title="keyword">Proof</span>. <span class="id" title="tactic">unfold</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest2.map"><span class="id" title="definition">map</span></a>. <span class="id" title="tactic">auto</span> 10. <span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
<span class="comment">(*&nbsp;GRADE_THEOREM&nbsp;0.25:&nbsp;typechecks&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.FixTest2.reduces" class="idref" href="#STLCExtended.Examples.FixTest2.reduces"><span class="id" title="definition">reduces</span></a> :<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest2.map"><span class="id" title="definition">map</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.a"><span class="id" title="abbreviation">a</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'succ'_x"><span class="id" title="notation">succ</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.a"><span class="id" title="abbreviation">a</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a>1 <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> 2 <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'nil'_x"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">))</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9cd10f7cb4dfdde0d448b6577b0f7bdd"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a>2 <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> 3 <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'nil'_x"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="comment">(*&nbsp;<br/>
&nbsp;&nbsp;unfold&nbsp;map.&nbsp;normalize.<br/>
*)</span><br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
<span class="comment">(*&nbsp;GRADE_THEOREM&nbsp;0.25:&nbsp;reduces&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">End</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest2"><span class="id" title="module">FixTest2</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Module</span> <a id="STLCExtended.Examples.FixTest3" class="idref" href="#STLCExtended.Examples.FixTest3"><span class="id" title="module">FixTest3</span></a>.<br/><hr class='doublespaceincode'/>
<span class="comment">(*&nbsp;equal&nbsp;=<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fix<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(\eq:Nat<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>Nat<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>Bool.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\m:Nat.&nbsp;\n:Nat.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tm_test0&nbsp;m&nbsp;then&nbsp;(tm_test0&nbsp;n&nbsp;then&nbsp;1&nbsp;else&nbsp;0)<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;tm_test0&nbsp;n&nbsp;then&nbsp;0<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;eq&nbsp;(pred&nbsp;m)&nbsp;(pred&nbsp;n))&nbsp;&nbsp;&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.Examples.FixTest3.equal" class="idref" href="#STLCExtended.Examples.FixTest3.equal"><span class="id" title="definition">equal</span></a> :=<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'fix'_x"><span class="id" title="notation">fix</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.eq"><span class="id" title="abbreviation">eq</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">→</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">→</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.m"><span class="id" title="abbreviation">m</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a> <a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.n"><span class="id" title="abbreviation">n</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.m"><span class="id" title="abbreviation">m</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.n"><span class="id" title="abbreviation">n</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> 1 <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> 0<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.n"><span class="id" title="abbreviation">n</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> 0<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.eq"><span class="id" title="abbreviation">eq</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">pred</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.m"><span class="id" title="abbreviation">m</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">pred</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.n"><span class="id" title="abbreviation">n</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">))))</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.FixTest3.typechecks" class="idref" href="#STLCExtended.Examples.FixTest3.typechecks"><span class="id" title="definition">typechecks</span></a> :<br/>
&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest3.equal"><span class="id" title="definition">equal</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a>.<br/>
<span class="id" title="keyword">Proof</span>. <span class="id" title="tactic">unfold</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest3.equal"><span class="id" title="definition">equal</span></a>. <span class="id" title="tactic">auto</span> 10. <span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
<span class="comment">(*&nbsp;GRADE_THEOREM&nbsp;0.25:&nbsp;typechecks&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.FixTest3.reduces" class="idref" href="#STLCExtended.Examples.FixTest3.reduces"><span class="id" title="definition">reduces</span></a> :<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest3.equal"><span class="id" title="definition">equal</span></a> 4 4<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#9cd10f7cb4dfdde0d448b6577b0f7bdd"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> 1.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="comment">(*&nbsp;<br/>
&nbsp;&nbsp;unfold&nbsp;equal.&nbsp;normalize.<br/>
*)</span><br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
<span class="comment">(*&nbsp;GRADE_THEOREM&nbsp;0.25:&nbsp;reduces&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.FixTest3.reduces2" class="idref" href="#STLCExtended.Examples.FixTest3.reduces2"><span class="id" title="definition">reduces2</span></a> :<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest3.equal"><span class="id" title="definition">equal</span></a> 4 5<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="MoreStlc.html#9cd10f7cb4dfdde0d448b6577b0f7bdd"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> 0.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="comment">(*&nbsp;<br/>
&nbsp;&nbsp;unfold&nbsp;equal.&nbsp;normalize.<br/>
*)</span><br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">End</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest3"><span class="id" title="module">FixTest3</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Module</span> <a id="STLCExtended.Examples.FixTest4" class="idref" href="#STLCExtended.Examples.FixTest4"><span class="id" title="module">FixTest4</span></a>.<br/><hr class='doublespaceincode'/>
<span class="comment">(*&nbsp;let&nbsp;evenodd&nbsp;=<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fix<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(\eo:&nbsp;(Nat<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>Nat&nbsp;*&nbsp;Nat<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>Nat).<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;let&nbsp;e&nbsp;=&nbsp;\n:Nat.&nbsp;tm_test0&nbsp;n&nbsp;then&nbsp;1&nbsp;else&nbsp;eo.tm_snd&nbsp;(pred&nbsp;n)&nbsp;in<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;let&nbsp;o&nbsp;=&nbsp;\n:Nat.&nbsp;tm_test0&nbsp;n&nbsp;then&nbsp;0&nbsp;else&nbsp;eo.tm_fst&nbsp;(pred&nbsp;n)&nbsp;in<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(e,o))&nbsp;in<br/>
&nbsp;&nbsp;&nbsp;&nbsp;let&nbsp;even&nbsp;=&nbsp;evenodd.tm_fst&nbsp;in<br/>
&nbsp;&nbsp;&nbsp;&nbsp;let&nbsp;odd&nbsp;&nbsp;=&nbsp;evenodd.tm_snd&nbsp;in<br/>
&nbsp;&nbsp;&nbsp;&nbsp;(even&nbsp;3,&nbsp;even&nbsp;4)<br/>
*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.Examples.FixTest4.eotest" class="idref" href="#STLCExtended.Examples.FixTest4.eotest"><span class="id" title="definition">eotest</span></a> :=<br/>
<a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">let</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.evenodd"><span class="id" title="abbreviation">evenodd</span></a> <a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">=</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'fix'_x"><span class="id" title="notation">fix</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.eo"><span class="id" title="abbreviation">eo</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">((</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#07385bcfe759c5c52b9f596e53f2c0f<sub>5</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">))</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.n"><span class="id" title="abbreviation">n</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.n"><span class="id" title="abbreviation">n</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> 1 <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.eo"><span class="id" title="abbreviation">eo.snd</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">pred</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.n"><span class="id" title="abbreviation">n</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">))</span></a><a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">,</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.n"><span class="id" title="abbreviation">n</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">:</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#1ad52bf8598c9e0c39505628d95be60b"><span class="id" title="notation">,</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.n"><span class="id" title="abbreviation">n</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> 0 <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.eo"><span class="id" title="abbreviation">eo.fst</span></a> <a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">pred</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.n"><span class="id" title="abbreviation">n</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">))</span></a><a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">in</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">let</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.even"><span class="id" title="abbreviation">even</span></a> <a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">=</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.evenodd"><span class="id" title="abbreviation">evenodd.fst</span></a> <a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">in</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">let</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.odd"><span class="id" title="abbreviation">odd</span></a>  <a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">=</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.evenodd"><span class="id" title="abbreviation">evenodd.snd</span></a> <a class="idref" href="MoreStlc.html#70f8b4f45f8b8110132e9be18ff33560"><span class="id" title="notation">in</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.Examples.even"><span class="id" title="abbreviation">even</span></a> 3<a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">,</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.even"><span class="id" title="abbreviation">even</span></a> 4<a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.FixTest4.typechecks" class="idref" href="#STLCExtended.Examples.FixTest4.typechecks"><span class="id" title="definition">typechecks</span></a> :<br/>
&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest4.eotest"><span class="id" title="definition">eotest</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a> <a class="idref" href="MoreStlc.html#07385bcfe759c5c52b9f596e53f2c0f<sub>5</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'Nat'"><span class="id" title="notation">Nat</span></a><a class="idref" href="MoreStlc.html#ac6d203e510f5b00c2daaeb576a325b<sub>8</sub>"><span class="id" title="notation">)</span></a>.<br/>
<span class="id" title="keyword">Proof</span>. <span class="id" title="tactic">unfold</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest4.eotest"><span class="id" title="definition">eotest</span></a>. <span class="id" title="tactic">eauto</span> 30. <span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
<span class="comment">(*&nbsp;GRADE_THEOREM&nbsp;0.25:&nbsp;typechecks&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Example</span> <a id="STLCExtended.Examples.FixTest4.reduces" class="idref" href="#STLCExtended.Examples.FixTest4.reduces"><span class="id" title="definition">reduces</span></a> :<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest4.eotest"><span class="id" title="definition">eotest</span></a> <a class="idref" href="MoreStlc.html#9cd10f7cb4dfdde0d448b6577b0f7bdd"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">(</span></a>0<a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">,</span></a> 1<a class="idref" href="MoreStlc.html#eef70aee8539936ab329e19df9d91f<sub>17</sub>"><span class="id" title="notation">)</span></a><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="comment">(*&nbsp;<br/>
&nbsp;&nbsp;unfold&nbsp;eotest.&nbsp;normalize.<br/>
*)</span><br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
<span class="comment">(*&nbsp;GRADE_THEOREM&nbsp;0.25:&nbsp;reduces&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">End</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples.FixTest4"><span class="id" title="module">FixTest4</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">End</span> <a class="idref" href="MoreStlc.html#STLCExtended.Examples"><span class="id" title="module">Examples</span></a>.<br/>
<font size=-2>&#9744;</font>
</div>


<div class="doc">
<a id="lab291"></a><h2 class="section">Properties of Typing</h2>

<div class="paragraph"> </div>

 The proofs of progress and preservation for this enriched system
    are essentially the same (though of course longer) as for the pure
    STLC. 
</div>

<div class="doc">
<a id="lab292"></a><h3 class="section">Progress</h3>

<div class="paragraph"> </div>

<a id="lab293"></a><h4 class="section">Exercise: 3 stars, standard (STLCE_progress)</h4>
 Complete the proof of <span class="inlinecode"><span class="id" title="tactic">progress</span></span>.

<div class="paragraph"> </div>

    Theorem: Suppose empty &#x22A2; t &#x2208; T.  Then either
      1. t is a value, or
      2. t <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> t' for some t'.

<div class="paragraph"> </div>

    Proof: By induction on the given typing derivation. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Theorem</span> <a id="STLCExtended.progress" class="idref" href="#STLCExtended.progress"><span class="id" title="lemma">progress</span></a> : <span class="id" title="keyword">∀</span> <a id="t:168" class="idref" href="#t:168"><span class="id" title="binder">t</span></a> <a id="T:169" class="idref" href="#T:169"><span class="id" title="binder">T</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t:168"><span class="id" title="variable">t</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T:169"><span class="id" title="variable">T</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#STLCExtended.value"><span class="id" title="inductive">value</span></a> <a class="idref" href="MoreStlc.html#t:168"><span class="id" title="variable">t</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#f031fe1957c4a4a8e217aa46af2b4e<sub>25</sub>"><span class="id" title="notation">∨</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#a883bdd010993579f99d60b3775bcf54"><span class="id" title="notation">∃</span></a> <a id="t':170" class="idref" href="#t':170"><span class="id" title="binder">t'</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#a883bdd010993579f99d60b3775bcf54"><span class="id" title="notation">,</span></a> <a class="idref" href="MoreStlc.html#t:168"><span class="id" title="variable">t</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t':170"><span class="id" title="variable">t'</span></a>.<br/>
<div class="togglescript" id="proofcontrol1" onclick="toggleDisplay('proof1');toggleDisplay('proofcontrol1')"><span class="show"></span></div>
<div class="proofscript" id="proof1" onclick="toggleDisplay('proof1');toggleDisplay('proofcontrol1')">
<span class="id" title="keyword">Proof</span> <span class="id" title="keyword">with</span> <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">t</span> <span class="id" title="var">T</span> <span class="id" title="var">Ht</span>.<br/>
&nbsp;&nbsp;<span class="id" title="var">remember</span> <span class="id" title="definition">empty</span> <span class="id" title="keyword">as</span> <span class="id" title="var">Gamma</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">generalize</span> <span class="id" title="tactic">dependent</span> <span class="id" title="var">HeqGamma</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">Ht</span>; <span class="id" title="tactic">intros</span> <span class="id" title="var">HeqGamma</span>; <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Var&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;The&nbsp;final&nbsp;rule&nbsp;in&nbsp;the&nbsp;given&nbsp;typing&nbsp;derivation&nbsp;cannot&nbsp;be<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="inlinecode"><span class="id" title="var">T_Var</span></span>,&nbsp;since&nbsp;it&nbsp;can&nbsp;never&nbsp;be&nbsp;the&nbsp;case&nbsp;that<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="inlinecode"><span class="id" title="var">empty</span></span> <span class="inlinecode">&#x22A2;</span> <span class="inlinecode"><span class="id" title="var">x</span></span> <span class="inlinecode">\<span class="id" title="tactic">in</span></span> <span class="inlinecode"><span class="id" title="var">T</span></span>&nbsp;(since&nbsp;the&nbsp;context&nbsp;is&nbsp;empty).&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">discriminate</span> <span class="id" title="var">H</span>.<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Abs&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;If&nbsp;the&nbsp;<span class="inlinecode"><span class="id" title="var">T_Abs</span></span>&nbsp;rule&nbsp;was&nbsp;the&nbsp;last&nbsp;used,&nbsp;then<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="inlinecode"><span class="id" title="var">t</span></span> <span class="inlinecode">=</span> <span class="inlinecode">\</span> <span class="inlinecode"><span class="id" title="var">x<sub>0</sub></span></span> <span class="inlinecode">:</span> <span class="inlinecode"><span class="id" title="var">T<sub>2</sub></span>,</span> <span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span>,&nbsp;which&nbsp;is&nbsp;a&nbsp;value.&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">left</span>...<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_App&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;If&nbsp;the&nbsp;last&nbsp;rule&nbsp;applied&nbsp;was&nbsp;T_App,&nbsp;then&nbsp;<span class="inlinecode"><span class="id" title="var">t</span></span> <span class="inlinecode">=</span> <span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span> <span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;we&nbsp;know&nbsp;from&nbsp;the&nbsp;form&nbsp;of&nbsp;the&nbsp;rule&nbsp;that<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="inlinecode"><span class="id" title="var">empty</span></span> <span class="inlinecode">&#x22A2;</span> <span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span> <span class="inlinecode">\<span class="id" title="tactic">in</span></span> <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span> <span class="inlinecode">→</span> <span class="inlinecode"><span class="id" title="var">T<sub>2</sub></span></span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="inlinecode"><span class="id" title="var">empty</span></span> <span class="inlinecode">&#x22A2;</span> <span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span> <span class="inlinecode">\<span class="id" title="tactic">in</span></span> <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;By&nbsp;the&nbsp;induction&nbsp;hypothesis,&nbsp;each&nbsp;of&nbsp;t<sub>1</sub>&nbsp;and&nbsp;t<sub>2</sub>&nbsp;either&nbsp;is<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;value&nbsp;or&nbsp;can&nbsp;take&nbsp;a&nbsp;step.&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">right</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHHt1</span>; <span class="id" title="tactic">subst</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>1</sub>&nbsp;is&nbsp;a&nbsp;value&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHHt2</span>; <span class="id" title="tactic">subst</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;t<sub>2</sub>&nbsp;is&nbsp;a&nbsp;value&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;If&nbsp;both&nbsp;<span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span>&nbsp;and&nbsp;<span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span>&nbsp;are&nbsp;values,&nbsp;then&nbsp;we&nbsp;know&nbsp;that<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span> <span class="inlinecode">=</span> <span class="inlinecode">\<span class="id" title="var">x<sub>0</sub></span></span> <span class="inlinecode">:</span> <span class="inlinecode"><span class="id" title="var">T<sub>0</sub></span>,</span> <span class="inlinecode"><span class="id" title="var">t<sub>11</sub></span></span>,&nbsp;since&nbsp;abstractions&nbsp;are&nbsp;the<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;values&nbsp;that&nbsp;can&nbsp;have&nbsp;an&nbsp;arrow&nbsp;type.&nbsp;&nbsp;But<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="inlinecode">(\<span class="id" title="var">x<sub>0</sub></span></span> <span class="inlinecode">:</span> <span class="inlinecode"><span class="id" title="var">T<sub>0</sub></span>,</span> <span class="inlinecode"><span class="id" title="var">t<sub>11</sub></span>)</span> <span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span> <span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode">[<span class="id" title="var">x</span>:=<span class="id" title="var">t<sub>2</sub></span>]<span class="id" title="var">t<sub>11</sub></span></span>&nbsp;by&nbsp;<span class="inlinecode"><span class="id" title="var">ST_AppAbs</span></span>.&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">try</span> <span class="id" title="var">solve_by_invert</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><span class="id" title="var">x<sub>0</sub></span> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a><span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;t<sub>2</sub>&nbsp;steps&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;If&nbsp;<span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span>&nbsp;is&nbsp;a&nbsp;value&nbsp;and&nbsp;<span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span> <span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">t<sub>2</sub>'</span></span>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;<span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span> <span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span> <span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span> <span class="inlinecode"><span class="id" title="var">t<sub>2</sub>'</span></span>&nbsp;by&nbsp;<span class="inlinecode"><span class="id" title="var">ST_App2</span></span>.&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H<sub>0</sub></span> <span class="id" title="keyword">as</span> [<span class="id" title="var">t<sub>2</sub>'</span> <span class="id" title="var">Hstp</span>]. <span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><span class="id" title="var">t<sub>1</sub></span> <span class="id" title="var">t<sub>2</sub>'</span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>1</sub>&nbsp;steps&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;Finally,&nbsp;If&nbsp;<span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span> <span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">t<sub>1</sub>'</span></span>,&nbsp;then&nbsp;<span class="inlinecode"><span class="id" title="var">t<sub>1</sub></span></span> <span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span> <span class="inlinecode"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span> <span class="inlinecode"><span class="id" title="var">t<sub>1</sub>'</span></span> <span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;by&nbsp;<span class="inlinecode"><span class="id" title="var">ST_App1</span></span>.&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span> <span class="id" title="keyword">as</span> [<span class="id" title="var">t<sub>1</sub>'</span> <span class="id" title="var">Hstp</span>]. <span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><span class="id" title="var">t<sub>1</sub>'</span> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Nat&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">left</span>...<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Succ&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">right</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHHt</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>1</sub>&nbsp;is&nbsp;a&nbsp;value&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">try</span> <span class="id" title="var">solve_by_invert</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">{</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#S"><span class="id" title="constructor">S</span></a> <span class="id" title="var">n</span><a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">}</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>1</sub>&nbsp;steps&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span> <span class="id" title="keyword">as</span> [<span class="id" title="var">t'</span> <span class="id" title="var">Hstp</span>].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'succ'_x"><span class="id" title="notation">succ</span></a> <span class="id" title="var">t'</span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Pred&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">right</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHHt</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>1</sub>&nbsp;is&nbsp;a&nbsp;value&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">try</span> <span class="id" title="var">solve_by_invert</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">{</span></a><span class="id" title="var">n</span> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Peano.html#::nat_scope:x_'-'_x"><span class="id" title="notation">-</span></a> 1<a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">}</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>1</sub>&nbsp;steps&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span> <span class="id" title="keyword">as</span> [<span class="id" title="var">t'</span> <span class="id" title="var">Hstp</span>].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'pred'_x"><span class="id" title="notation">pred</span></a> <span class="id" title="var">t'</span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Mult&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">right</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHHt1</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>1</sub>&nbsp;is&nbsp;a&nbsp;value&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHHt2</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;t<sub>2</sub>&nbsp;is&nbsp;a&nbsp;value&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">try</span> <span class="id" title="var">solve_by_invert</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H<sub>0</sub></span>; <span class="id" title="tactic">try</span> <span class="id" title="var">solve_by_invert</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">{</span></a><span class="id" title="var">n</span> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Peano.html#ea2ff3d561159081cea6fb2e8113cc<sub>54</sub>"><span class="id" title="notation">×</span></a> <span class="id" title="var">n<sub>0</sub></span><a class="idref" href="MoreStlc.html#10a3eaf4381f471bf62a172f43bb02e<sub>6</sub>"><span class="id" title="notation">}</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;t<sub>2</sub>&nbsp;steps&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H<sub>0</sub></span> <span class="id" title="keyword">as</span> [<span class="id" title="var">t<sub>2</sub>'</span> <span class="id" title="var">Hstp</span>].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="MoreStlc.html#43eb4b39e17c20cb1da938909e269aa<sub>6</sub>"><span class="id" title="notation">×</span></a> <span class="id" title="var">t<sub>2</sub>'</span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>1</sub>&nbsp;steps&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span> <span class="id" title="keyword">as</span> [<span class="id" title="var">t<sub>1</sub>'</span> <span class="id" title="var">Hstp</span>].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><span class="id" title="var">t<sub>1</sub>'</span> <a class="idref" href="MoreStlc.html#43eb4b39e17c20cb1da938909e269aa<sub>6</sub>"><span class="id" title="notation">×</span></a> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Test0&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">right</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHHt1</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>1</sub>&nbsp;is&nbsp;a&nbsp;value&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">try</span> <span class="id" title="var">solve_by_invert</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">n</span> <span class="id" title="keyword">as</span> [|<span class="id" title="var">n'</span>].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;n<sub>1</sub>=0&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <span class="id" title="var">t<sub>2</sub></span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;n<sub>1</sub>&lt;&gt;0&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <span class="id" title="var">t<sub>3</sub></span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>1</sub>&nbsp;steps&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span> <span class="id" title="keyword">as</span> [<span class="id" title="var">t<sub>1</sub>'</span> <span class="id" title="var">H<sub>0</sub></span>].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">if<sub>0</sub></span></a> <span class="id" title="var">t<sub>1</sub>'</span> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <span class="id" title="var">t<sub>2</sub></span> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::'if<sub>0</sub>'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <span class="id" title="var">t<sub>3</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Inl&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHHt</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>1</sub>&nbsp;steps&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">right</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span> <span class="id" title="keyword">as</span> [<span class="id" title="var">t<sub>1</sub>'</span> <span class="id" title="var">Hstp</span>]...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;exists&nbsp;(tm_inl&nbsp;_&nbsp;t<sub>1</sub>')...&nbsp;*)</span><br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Inr&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHHt</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>1</sub>&nbsp;steps&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">right</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span> <span class="id" title="keyword">as</span> [<span class="id" title="var">t<sub>1</sub>'</span> <span class="id" title="var">Hstp</span>]...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;exists&nbsp;(tm_inr&nbsp;_&nbsp;t<sub>1</sub>')...&nbsp;*)</span><br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Case&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">right</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHHt1</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>0</sub>&nbsp;is&nbsp;a&nbsp;value&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">try</span> <span class="id" title="var">solve_by_invert</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;t<sub>0</sub>&nbsp;is&nbsp;inl&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><span class="id" title="var">x<sub>1</sub></span><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><span class="id" title="var">v</span><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a><span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;t<sub>0</sub>&nbsp;is&nbsp;inr&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><span class="id" title="var">x<sub>2</sub></span><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><span class="id" title="var">v</span><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a><span class="id" title="var">t<sub>2</sub></span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>0</sub>&nbsp;steps&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span> <span class="id" title="keyword">as</span> [<span class="id" title="var">t<sub>0</sub>'</span> <span class="id" title="var">Hstp</span>].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">case</span></a> <span class="id" title="var">t<sub>0</sub>'</span> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">of</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inl</span></a> <span class="id" title="var">x<sub>1</sub></span> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">inr</span></a> <span class="id" title="var">x<sub>2</sub></span> <a class="idref" href="MoreStlc.html#67071c1f1e0255702ad90f4cb618f115"><span class="id" title="notation">⇒</span></a> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Nil&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">left</span>...<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Cons&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHHt1</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;head&nbsp;is&nbsp;a&nbsp;value&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHHt2</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;tail&nbsp;steps&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">right</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H<sub>0</sub></span> <span class="id" title="keyword">as</span> [<span class="id" title="var">t<sub>2</sub>'</span> <span class="id" title="var">Hstp</span>].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> <span class="id" title="var">t<sub>2</sub>'</span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;head&nbsp;steps&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">right</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span> <span class="id" title="keyword">as</span> [<span class="id" title="var">t<sub>1</sub>'</span> <span class="id" title="var">Hstp</span>].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><span class="id" title="var">t<sub>1</sub>'</span> <a class="idref" href="MoreStlc.html#STLCExtended.:stlc::x_'::'_x"><span class="id" title="notation">::</span></a> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Lcase&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">right</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHHt1</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>1</sub>&nbsp;is&nbsp;a&nbsp;value&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">try</span> <span class="id" title="var">solve_by_invert</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;t<sub>1</sub>=tm_nil&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <span class="id" title="var">t<sub>2</sub></span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;t<sub>1</sub>=tm_cons&nbsp;v<sub>1</sub>&nbsp;v<sub>2</sub>&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><span class="id" title="var">x<sub>2</sub></span><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><span class="id" title="var">v<sub>2</sub></span><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><span class="id" title="var">x<sub>1</sub></span><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><span class="id" title="var">v<sub>1</sub></span><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a><span class="id" title="var">t<sub>3</sub></span><a class="idref" href="MoreStlc.html#12c502a9ec79bd3b5587ea74d3c86fae"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;t<sub>1</sub>&nbsp;steps&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span> <span class="id" title="keyword">as</span> [<span class="id" title="var">t<sub>1</sub>'</span> <span class="id" title="var">Hstp</span>].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">case</span></a> <span class="id" title="var">t<sub>1</sub>'</span> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">of</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">nil</span></a> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <span class="id" title="var">t<sub>2</sub></span> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">|</span></a> <span class="id" title="var">x<sub>1</sub></span> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">::</span></a> <span class="id" title="var">x<sub>2</sub></span> <a class="idref" href="MoreStlc.html#de876c64e601b25611daf48d0a4b5481"><span class="id" title="notation">⇒</span></a> <span class="id" title="var">t<sub>3</sub></span><a class="idref" href="MoreStlc.html#9593265f23640347d8baf3ded78adc0e"><span class="id" title="notation">}&gt;</span></a>...<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Unit&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">left</span>...<br/><hr class='doublespaceincode'/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;Complete&nbsp;the&nbsp;proof.&nbsp;*)</span><br/><hr class='doublespaceincode'/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;pairs&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;let&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;fix&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
</div>

<br/>
<span class="comment">(*&nbsp;Do&nbsp;not&nbsp;modify&nbsp;the&nbsp;following&nbsp;line:&nbsp;*)</span><br/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.manual_grade_for_progress" class="idref" href="#STLCExtended.manual_grade_for_progress"><span class="id" title="definition">manual_grade_for_progress</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#option"><span class="id" title="inductive">option</span></a> (<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nat"><span class="id" title="inductive">nat</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac<sub>4</sub>"><span class="id" title="notation">×</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a>) := <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#None"><span class="id" title="constructor">None</span></a>.<br/>
<font size=-2>&#9744;</font>
</div>


<div class="doc">
<a id="lab294"></a><h2 class="section">Weakening</h2>

<div class="paragraph"> </div>

 The weakening claim and (automated) proof are exactly the
    same as for the original STLC. (We only need to increase the
    search depth of eauto to 7.) 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="STLCExtended.weakening" class="idref" href="#STLCExtended.weakening"><span class="id" title="lemma">weakening</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:171" class="idref" href="#Gamma:171"><span class="id" title="binder">Gamma</span></a> <a id="Gamma':172" class="idref" href="#Gamma':172"><span class="id" title="binder">Gamma'</span></a> <a id="t:173" class="idref" href="#t:173"><span class="id" title="binder">t</span></a> <a id="T:174" class="idref" href="#T:174"><span class="id" title="binder">T</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="definition">inclusion</span> <a class="idref" href="MoreStlc.html#Gamma:171"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#Gamma':172"><span class="id" title="variable">Gamma'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:171"><span class="id" title="variable">Gamma</span></a>  <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t:173"><span class="id" title="variable">t</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T:174"><span class="id" title="variable">T</span></a>  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma':172"><span class="id" title="variable">Gamma'</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t:173"><span class="id" title="variable">t</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T:174"><span class="id" title="variable">T</span></a>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">Gamma</span> <span class="id" title="var">Gamma'</span> <span class="id" title="var">t</span> <span class="id" title="var">T</span> <span class="id" title="var">H</span> <span class="id" title="var">Ht</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">generalize</span> <span class="id" title="tactic">dependent</span> <span class="id" title="var">Gamma'</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">Ht</span>; <span class="id" title="tactic">eauto</span> 7 <span class="id" title="keyword">using</span> <span class="id" title="lemma">inclusion_update</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Lemma</span> <a id="STLCExtended.weakening_empty" class="idref" href="#STLCExtended.weakening_empty"><span class="id" title="lemma">weakening_empty</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:175" class="idref" href="#Gamma:175"><span class="id" title="binder">Gamma</span></a> <a id="t:176" class="idref" href="#t:176"><span class="id" title="binder">t</span></a> <a id="T:177" class="idref" href="#T:177"><span class="id" title="binder">T</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t:176"><span class="id" title="variable">t</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T:177"><span class="id" title="variable">T</span></a>  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:175"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t:176"><span class="id" title="variable">t</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T:177"><span class="id" title="variable">T</span></a>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">Gamma</span> <span class="id" title="var">t</span> <span class="id" title="var">T</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="MoreStlc.html#STLCExtended.weakening"><span class="id" title="lemma">weakening</span></a>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">discriminate</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<div class="doc">
<a id="lab295"></a><h3 class="section">Substitution</h3>

<div class="paragraph"> </div>

<a id="lab296"></a><h4 class="section">Exercise: 2 stars, standard (STLCE_subst_preserves_typing)</h4>
 Complete the proof of <span class="inlinecode"><span class="id" title="var">substitution_preserves_typing</span></span>. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="STLCExtended.substitution_preserves_typing" class="idref" href="#STLCExtended.substitution_preserves_typing"><span class="id" title="lemma">substitution_preserves_typing</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:178" class="idref" href="#Gamma:178"><span class="id" title="binder">Gamma</span></a> <a id="x:179" class="idref" href="#x:179"><span class="id" title="binder">x</span></a> <a id="U:180" class="idref" href="#U:180"><span class="id" title="binder">U</span></a> <a id="t:181" class="idref" href="#t:181"><span class="id" title="binder">t</span></a> <a id="v:182" class="idref" href="#v:182"><span class="id" title="binder">v</span></a> <a id="T:183" class="idref" href="#T:183"><span class="id" title="binder">T</span></a>,<br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">(</span></a><a class="idref" href="MoreStlc.html#x:179"><span class="id" title="variable">x</span></a> <span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>&#x22A2;</span><span style='font-size:90%;'>&gt;</span></span></span></span></span> <a class="idref" href="MoreStlc.html#U:180"><span class="id" title="variable">U</span></a> <span class="id" title="notation">;</span> <a class="idref" href="MoreStlc.html#Gamma:178"><span class="id" title="variable">Gamma</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">)</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t:181"><span class="id" title="variable">t</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T:183"><span class="id" title="variable">T</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#v:182"><span class="id" title="variable">v</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#U:180"><span class="id" title="variable">U</span></a>   <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#Gamma:178"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">[</span></a><a class="idref" href="MoreStlc.html#x:179"><span class="id" title="variable">x</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">:=</span></a><a class="idref" href="MoreStlc.html#v:182"><span class="id" title="variable">v</span></a><a class="idref" href="MoreStlc.html#d35e897ce075945f087982f143864505"><span class="id" title="notation">]</span></a><a class="idref" href="MoreStlc.html#t:181"><span class="id" title="variable">t</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T:183"><span class="id" title="variable">T</span></a>.<br/>
<div class="togglescript" id="proofcontrol2" onclick="toggleDisplay('proof2');toggleDisplay('proofcontrol2')"><span class="show"></span></div>
<div class="proofscript" id="proof2" onclick="toggleDisplay('proof2');toggleDisplay('proofcontrol2')">
<span class="id" title="keyword">Proof</span> <span class="id" title="keyword">with</span> <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">Gamma</span> <span class="id" title="var">x</span> <span class="id" title="var">U</span> <span class="id" title="var">t</span> <span class="id" title="var">v</span> <span class="id" title="var">T</span> <span class="id" title="var">Ht</span> <span class="id" title="var">Hv</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">generalize</span> <span class="id" title="tactic">dependent</span> <span class="id" title="var">Gamma</span>. <span class="id" title="tactic">generalize</span> <span class="id" title="tactic">dependent</span> <span class="id" title="var">T</span>.<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;Proof:&nbsp;By&nbsp;induction&nbsp;on&nbsp;the&nbsp;term&nbsp;<span class="inlinecode"><span class="id" title="var">t</span></span>.&nbsp;&nbsp;Most&nbsp;cases&nbsp;follow<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;directly&nbsp;from&nbsp;the&nbsp;IH,&nbsp;with&nbsp;the&nbsp;exception&nbsp;of&nbsp;<span class="inlinecode"><span class="id" title="var">var</span></span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;<span class="inlinecode"><span class="id" title="var">abs</span></span>.&nbsp;These&nbsp;aren't&nbsp;automatic&nbsp;because&nbsp;we&nbsp;must<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reason&nbsp;about&nbsp;how&nbsp;the&nbsp;variables&nbsp;interact.&nbsp;The&nbsp;proofs<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;these&nbsp;cases&nbsp;are&nbsp;similar&nbsp;to&nbsp;the&nbsp;ones&nbsp;in&nbsp;STLC.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;We&nbsp;refer&nbsp;the&nbsp;reader&nbsp;to&nbsp;StlcProp.v&nbsp;for&nbsp;explanations.&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">t</span>; <span class="id" title="tactic">intros</span> <span class="id" title="var">T</span> <span class="id" title="var">Gamma</span> <span class="id" title="var">H</span>;<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;in&nbsp;each&nbsp;case,&nbsp;we'll&nbsp;want&nbsp;to&nbsp;get&nbsp;at&nbsp;the&nbsp;derivation&nbsp;of&nbsp;H&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">clear</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">subst</span>; <span class="id" title="tactic">simpl</span>; <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;var&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rename</span> <span class="id" title="var">s</span> <span class="id" title="var">into</span> <span class="id" title="var">y</span>. <span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x</span> <span class="id" title="var">y</span>); <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;x=y&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_eq</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>2</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">injection</span> <span class="id" title="var">H<sub>2</sub></span> <span class="id" title="keyword">as</span> <span class="id" title="var">H<sub>2</sub></span>; <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <a class="idref" href="MoreStlc.html#STLCExtended.weakening_empty"><span class="id" title="lemma">weakening_empty</span></a>. <span class="id" title="tactic">assumption</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;x&lt;&gt;y&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <a class="idref" href="MoreStlc.html#STLCExtended.T_Var"><span class="id" title="constructor">T_Var</span></a>. <span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_neq</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>2</sub></span>; <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;abs&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rename</span> <span class="id" title="var">s</span> <span class="id" title="var">into</span> <span class="id" title="var">y</span>, <span class="id" title="var">t</span> <span class="id" title="var">into</span> <span class="id" title="var">S</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x</span> <span class="id" title="var">y</span>); <span class="id" title="tactic">subst</span>; <span class="id" title="tactic">apply</span> <a class="idref" href="MoreStlc.html#STLCExtended.T_Abs"><span class="id" title="constructor">T_Abs</span></a>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;x=y&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_shadow</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>5</sub></span>. <span class="id" title="tactic">assumption</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;x&lt;&gt;y&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <span class="id" title="var">IHt</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_permute</span>; <span class="id" title="tactic">auto</span>.<br/><hr class='doublespaceincode'/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;tm_case&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rename</span> <span class="id" title="var">s</span> <span class="id" title="var">into</span> <span class="id" title="var">x<sub>1</sub></span>, <span class="id" title="var">s<sub>0</sub></span> <span class="id" title="var">into</span> <span class="id" title="var">x<sub>2</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="MoreStlc.html#STLCExtended.T_Case"><span class="id" title="constructor">T_Case</span></a>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;left&nbsp;arm&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x</span> <span class="id" title="var">x<sub>1</sub></span>); <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;x&nbsp;=&nbsp;x<sub>1</sub>&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_shadow</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>8</sub></span>. <span class="id" title="tactic">assumption</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;x&nbsp;&lt;&gt;&nbsp;x<sub>1</sub>&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <span class="id" title="var">IHt2</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_permute</span>; <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;right&nbsp;arm&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x</span> <span class="id" title="var">x<sub>2</sub></span>); <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;x&nbsp;=&nbsp;x<sub>2</sub>&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_shadow</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>9</sub></span>. <span class="id" title="tactic">assumption</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;x&nbsp;&lt;&gt;&nbsp;x<sub>2</sub>&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <span class="id" title="var">IHt3</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_permute</span>; <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;tm_lcase&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rename</span> <span class="id" title="var">s</span> <span class="id" title="var">into</span> <span class="id" title="var">y<sub>1</sub></span>, <span class="id" title="var">s<sub>0</sub></span> <span class="id" title="var">into</span> <span class="id" title="var">y<sub>2</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="MoreStlc.html#STLCExtended.T_Lcase"><span class="id" title="constructor">T_Lcase</span></a>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x</span> <span class="id" title="var">y<sub>1</sub></span>); <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;x=y<sub>1</sub>&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">y<sub>2</sub></span> <span class="id" title="var">y<sub>1</sub></span>); <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;y<sub>2</sub>=y<sub>1</sub>&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">repeat</span> <span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_shadow</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>9</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_shadow</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">assumption</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_permute</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>9</sub></span>; [|<span class="id" title="tactic">assumption</span>].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_shadow</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>9</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_permute</span>;  <span class="id" title="tactic">assumption</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;x&lt;&gt;y<sub>1</sub>&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x</span> <span class="id" title="var">y<sub>2</sub></span>); <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;x=y<sub>2</sub>&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_shadow</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>9</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">assumption</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;× <span class="comment">(*&nbsp;x&lt;&gt;y<sub>2</sub>&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <span class="id" title="var">IHt3</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> (<span class="id" title="lemma">update_permute</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">n<sub>0</sub></span>) <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>9</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> (<span class="id" title="lemma">update_permute</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">n</span>) <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>9</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">assumption</span>.<br/><hr class='doublespaceincode'/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;Complete&nbsp;the&nbsp;proof.&nbsp;*)</span><br/><hr class='doublespaceincode'/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
</div>

<br/>
<span class="comment">(*&nbsp;Do&nbsp;not&nbsp;modify&nbsp;the&nbsp;following&nbsp;line:&nbsp;*)</span><br/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.manual_grade_for_substitution_preserves_typing" class="idref" href="#STLCExtended.manual_grade_for_substitution_preserves_typing"><span class="id" title="definition">manual_grade_for_substitution_preserves_typing</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#option"><span class="id" title="inductive">option</span></a> (<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nat"><span class="id" title="inductive">nat</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac<sub>4</sub>"><span class="id" title="notation">×</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a>) := <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#None"><span class="id" title="constructor">None</span></a>.<br/>
<font size=-2>&#9744;</font>
</div>


<div class="doc">
<a id="lab297"></a><h3 class="section">Preservation</h3>

<div class="paragraph"> </div>

<a id="lab298"></a><h4 class="section">Exercise: 3 stars, standard (STLCE_preservation)</h4>
 Complete the proof of <span class="inlinecode"><span class="id" title="var">preservation</span></span>. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Theorem</span> <a id="STLCExtended.preservation" class="idref" href="#STLCExtended.preservation"><span class="id" title="lemma">preservation</span></a> : <span class="id" title="keyword">∀</span> <a id="t:184" class="idref" href="#t:184"><span class="id" title="binder">t</span></a> <a id="t':185" class="idref" href="#t':185"><span class="id" title="binder">t'</span></a> <a id="T:186" class="idref" href="#T:186"><span class="id" title="binder">T</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t:184"><span class="id" title="variable">t</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T:186"><span class="id" title="variable">T</span></a>  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="MoreStlc.html#t:184"><span class="id" title="variable">t</span></a> <a class="idref" href="MoreStlc.html#STLCExtended.:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="MoreStlc.html#t':185"><span class="id" title="variable">t'</span></a>  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="MoreStlc.html#t':185"><span class="id" title="variable">t'</span></a> <a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">\</span></a><a class="idref" href="MoreStlc.html#93ddac5fbc94395177f473c7b12aad0d"><span class="id" title="notation">in</span></a> <a class="idref" href="MoreStlc.html#T:186"><span class="id" title="variable">T</span></a>.<br/>
<div class="togglescript" id="proofcontrol3" onclick="toggleDisplay('proof3');toggleDisplay('proofcontrol3')"><span class="show"></span></div>
<div class="proofscript" id="proof3" onclick="toggleDisplay('proof3');toggleDisplay('proofcontrol3')">
<span class="id" title="keyword">Proof</span> <span class="id" title="keyword">with</span> <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">t</span> <span class="id" title="var">t'</span> <span class="id" title="var">T</span> <span class="id" title="var">HT</span>. <span class="id" title="tactic">generalize</span> <span class="id" title="tactic">dependent</span> <span class="id" title="var">t'</span>.<br/>
&nbsp;&nbsp;<span class="id" title="var">remember</span> <span class="id" title="definition">empty</span> <span class="id" title="keyword">as</span> <span class="id" title="var">Gamma</span>.<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;Proof:&nbsp;By&nbsp;induction&nbsp;on&nbsp;the&nbsp;given&nbsp;typing&nbsp;derivation.&nbsp;&nbsp;Many<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cases&nbsp;are&nbsp;contradictory&nbsp;(<span class="inlinecode"><span class="id" title="var">T_Var</span></span>,&nbsp;<span class="inlinecode"><span class="id" title="var">T_Abs</span></span>).&nbsp;&nbsp;We&nbsp;show&nbsp;just<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;interesting&nbsp;ones.&nbsp;Again,&nbsp;we&nbsp;refer&nbsp;the&nbsp;reader&nbsp;to<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StlcProp.v&nbsp;for&nbsp;explanations.&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">HT</span>;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">t'</span> <span class="id" title="var">HE</span>; <span class="id" title="tactic">subst</span>; <span class="id" title="tactic">inversion</span> <span class="id" title="var">HE</span>; <span class="id" title="tactic">subst</span>...<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_App&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">HE</span>; <span class="id" title="tactic">subst</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;ST_AppAbs&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <a class="idref" href="MoreStlc.html#STLCExtended.substitution_preserves_typing"><span class="id" title="axiom">substitution_preserves_typing</span></a> <span class="id" title="keyword">with</span> <span class="id" title="var">T<sub>2</sub></span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">HT<sub>1</sub></span>...<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;T_Case&nbsp;*)</span><br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;ST_CaseInl&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">HT<sub>1</sub></span>; <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="MoreStlc.html#STLCExtended.substitution_preserves_typing"><span class="id" title="axiom">substitution_preserves_typing</span></a>...<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;ST_CaseInr&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">HT<sub>1</sub></span>; <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="MoreStlc.html#STLCExtended.substitution_preserves_typing"><span class="id" title="axiom">substitution_preserves_typing</span></a>...<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Lcase&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;ST_LcaseCons&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">HT<sub>1</sub></span>; <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <a class="idref" href="MoreStlc.html#STLCExtended.substitution_preserves_typing"><span class="id" title="axiom">substitution_preserves_typing</span></a> <span class="id" title="keyword">with</span> <a class="idref" href="MoreStlc.html#4790eac4da69227166d84a2e2fa965df"><span class="id" title="notation">&lt;<span style='letter-spacing:-.4em;'>{</span>{</span></a><a class="idref" href="MoreStlc.html#STLCExtended.:stlc_ty::'List'_x"><span class="id" title="notation">List</span></a> <span class="id" title="var">T<sub>1</sub></span><a class="idref" href="MoreStlc.html#4790eac4da69227166d84a2e2fa965df"><span class="id" title="notation"><span style='letter-spacing:-.4em;'>}</span>}&gt;</span></a>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <a class="idref" href="MoreStlc.html#STLCExtended.substitution_preserves_typing"><span class="id" title="axiom">substitution_preserves_typing</span></a> <span class="id" title="keyword">with</span> <span class="id" title="var">T<sub>1</sub></span>...<br/><hr class='doublespaceincode'/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;Complete&nbsp;the&nbsp;proof.&nbsp;*)</span><br/><hr class='doublespaceincode'/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;fst&nbsp;and&nbsp;snd&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;let&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;fix&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
</div>

<br/>
<span class="comment">(*&nbsp;Do&nbsp;not&nbsp;modify&nbsp;the&nbsp;following&nbsp;line:&nbsp;*)</span><br/>
<span class="id" title="keyword">Definition</span> <a id="STLCExtended.manual_grade_for_preservation" class="idref" href="#STLCExtended.manual_grade_for_preservation"><span class="id" title="definition">manual_grade_for_preservation</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#option"><span class="id" title="inductive">option</span></a> (<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nat"><span class="id" title="inductive">nat</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac<sub>4</sub>"><span class="id" title="notation">×</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a>) := <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#None"><span class="id" title="constructor">None</span></a>.<br/>
<font size=-2>&#9744;</font>
</div>

<div class="code">

<br/>
<span class="id" title="keyword">End</span> <a class="idref" href="MoreStlc.html#STLCExtended"><span class="id" title="module">STLCExtended</span></a>.<br/><hr class='doublespaceincode'/>
<span class="comment">(*&nbsp;2020-08-24&nbsp;16:13&nbsp;*)</span><br/>
</div>
</div>

<div id="footer">
<hr/><a href="coqindex.html">Index</a><hr/>This page has been generated by <a href="http://coq.inria.fr/">coqdoc</a>
</div>

</div>

</body>
</html>